During his life he held several posts, many coinciding with the European Peninsular War: lieutenant general in the military, secretary and councilor of the "Conselho Ultramarino" ("Overseas Council"), governor of Algarve and Governor/Captain-General of the Azores. He was also a member of the committee that formed the draft of the constitutional charter in 1823, before returning to academia (becoming a professor of mathematics at the "Academia Real de Marinha", a deputy director of the "Academia Militar do Rio de Janeiro", secretary of the Academia Real das Ciências de Lisboa and fellow Royal Society of London, among other honours. He was one of the pioneers in differential calculus and one of the most notable historians of mathematics in Portugal.