We do not know exactly how long Nunes remained at Salamanca after he graduated but by 1527 he had returned to Portugal. There he began teaching Prince Luis, the brother of Joao o Piedoso. Joao had become king of Portugal (known as John III or John the pious) in 1521 at the age of nineteen. Nunes acted as tutor to Luis until July 1531. Starting in 1527, Nunes taught navigation skills to Martim Afonso de Sousa, who led the first colonizing expedition to Brazil in 1530, and to another naval officer Joao de Castro. In fact Joao de Castro, in addition to a highly successful career in the Portuguese navy in North Africa and India, was himself an excellent scientist writing three important works on the science of navigation in 1538, 1538-39 and 1541. On 16 November 1529 king Joao o Piedoso appointed Nunes as "Cosmographer of the Kingdom of Portugal". One of his official duties as Cosmographer was to give classes in navigation to seafarers. A few weeks later, on 4 December, he began teaching moral philosophy at the University of Lisbon. This appointment was only as a substitute for the professor, but on 15 January 1530 he was appointed to the chair of Logic. He taught logic for at least a year but it appears that his classes were not very successful with students so he moved to the chair of metaphysics on 4 April 1532. During this period, however, Nunes was working towards a doctorate in medicine and after successfully taking examinations on 16 February 1532 be was awarded his medical doctorate on 3 March.
It is not entirely clear where Nunes was over the period between 1532 and 1544. Part of the time he was in Lisbon but there is also evidence that he spent time in Spain. Certainly during this period he was officially employed by the University of Lisbon and he supervised the studies of a number of doctoral students over these years. He was also working during these years on writing a number of books. He began writing Libro de Algebra in 1534 although only published the completed work thirty-three years later. The book is in three parts, the first part dealing with equations of the first and second degree and the third part dealing with equations of the third degree. The middle part of the text studies the theory of proportion and algebraic manipulation. The first of Nunes books to be published was Tratado da Sphera in 1537. This book contained Nunes' edition of Sacrobosco's Tractatus de Sphaera, of Peurbach's Theoricae nouae planetarum, and of Book I of Ptolemy's Geographia. In addition Nunes added two works of his own on navigation. His next published work was De Crepusculis (1542) in which he addressed a problem posed to him by one of his pupils, Prince Cardinal Henrique the son of Manuel I who became archbishop of Braga in 1534 and, after a career in the church, king of Portugal in 1578. Nunes taught Henrique from October 1531 until his appointment in Braga. The question he had posed to Nunes was "Which day has the shortest twilight?" and it was the question of the duration of twilight that Nunes addressed in De Crepusculis. Gonzalo de Reparaz Ruiz writes :-
[Nunes] was teacher of mathematics of the son of D Manuel, the Infant Henry, to whom he demonstrated the method of establishing the latitude of a point by the height of the sun and how to indicate this on a chart. This demonstration he repeated before the King in 1533. In the preface which he had written to his Libro de Algebra and dedicated to his former pupil the Cardinal Henry, who was then Regent of the country, Nunes states that the publication of this book was delayed by other "very varied" works which, he asserts, had taken his time for several years.Nunes moved to the University of Coimbra to take up the Chair of Mathematics on 16 October 1544, a post he held until 1562 although he spent four years away from the University living in Lisbon during the period 1557-61. The Chair of Mathematics was a new post in the University of Coimbra and it was set up to provide instruction in the technical requirements for navigation, clearly a topic of great importance in Portugal at this period when control of sea trade was the chief source of Portuguese wealth. While at Coimbra Nunes taught Christopher Clavius. He had been appointed Royal Cosmographer in 1529 but was promoted to Chief Royal Cosmographer on 22 December 1547. He held this post until his death. In 1548 the king, Joao o Piedoso, honoured Nunes by naming him Cavaleiro do Hábito de Cristo (Knight of the Order of Christ).
Soon after moving to Coimbra Nunes published De erratis Orontii Finaei in 1546. This book was written to show that Oronce Fine's attempts to solve the three classical problems of squaring the circle, trisecting an arbitrary angle and to doubling the cube were incorrect. Around 1550 he made the discovery for which today he is best known, namely his investigation of the loxodrome or, to use the name that Nunes invented, the rhumb line. In many ways the loxodrome is a natural curve for someone interested in navigation to examine for it is the curve that a ship will follow if it always follows the same compass setting. Another way to think of the curve is that it is obtained by cutting the meridians on the sphere at a constant angle. A loxodrome will, in fact, spiral towards the pole but its importance to map projections is that the loxodrome become a straight line in the Mercator projection of the sphere. It was Willebrord Snell who named Nunes' rhumb line the loxodrome.
In 1566 Nunes published his own collected works as Petri Nonii Salaciensis Opera which contains improved versions of his earlier works with additional material :-
This book is a very much extended compilation of Nunes works about navigation and was, at the time, the state of the art of nautical science. It also included a commentary to Aristotle's mechanical problem on the motion of a boat propelled by oars.A second improved edition of this book was published in 1573 under a different title, namely De arte atque ratione navigandi. In 1567 he published Libro de Algebra mostly written many years earlier as we noted above. We note that John Martyn published in  what is claimed to be an early version of Nunes' algebra text. However, Giovanna Cifoletti  casts doubt on whether the published manuscript was written by Nunes or whether it was a set of notes taken by one of Nunes' students. In 1571 he put together two of his previously published texts, De Crepusculis and De erratis Orontii Finaei, bring them out in a single volume. Outside mathematics he worked in geography, physics, cosmology and he wrote poetry. Examples of his poetry are published in .
Nunes devised a system to allow fractional parts of a degree to be measured. He describes it as:-
... drawing on the face of a quadrant for measuring angles 45 concentric arcs, one of which was divided into 90 equal parts or degrees, and the remainder into 89, 88, 87, 86, etc., successively, the last being divided into 46 equal parts. When the index did not exactly cut one of the divisions of the arc of degrees, it passed through or near to one of the divisions of one or other of the other arcs; and by noting the place of that division the fractional parts of a degree were calculated.In 1572 Nunes was called to court to preside over the reform of weights and measures. He stayed in Lisbon for two years before finally returning to Coimbra.
Finally, let us note the friendship between John Dee and Nunes. Dee wrote in 1558:-
... if my work cannot be finished or published while I remain alive, I have bequeathed it to that most learned and grave man who is the sole relic and ornament and prop of the mathematical arts among us, D D Pedro Nunes, of Salacia, and not long since prayed him strenuously that, if this work of mine should be brought to him after my death, he would kindly and humanely take it under his protection and use it in every way as if it were his own: that he would deign to complete it, finally, correct it, and polish it for the public use of philosophers as if it were entirely his. And I do not doubt that he will himself be a party to my wish if his life and health remain unimpaired, since he loves me faithfully and it is inborn in him by nature, and reinforced by will, industry, and habit, to cultivate diligently the arts most necessary to a Christian state.
Article by: J J O'Connor and E F Robertson