John Leslie's mother was Anne Carstairs from Largo in Fife (about 10 miles south of St Andrews). His father, Robert Leslie, was a joiner and cabinet-maker with some knowledge of mathematics. John had an older brother Alexander who also studied mathematics and John learnt mathematics at home being taught partly by his father and partly by his older brother Alexander. He attended three local schools but his total school education still amounted to no more than a year before he began his university studies.
Leslie entered the University of St Andrews in 1779 at the age of 13. At this time the Scottish Universities competed with the schools for the most able pupils so it is not surprising that he entered university at such a young age. The Regius Professor of Mathematics at St Andrews at the time was Nicholas Vilant, and Leslie studied under him and also under his assistant John West. Leslie's abilities were quickly noticed by the Principal of the University who arranged a scholarship to enable Leslie to continue his studies. It was assumed that once his education was complete that Leslie would join the Church, which was the main occupation for educated boys, and it was on these conditions that the Principal gave the scholarship. While an undergraduate Leslie became friendly with John Playfair who was minister at Liff near Dundee, but an outstanding mathematician. In 1783 Playfair left the Church to became a private tutor for five years to Robert and Ronald Ferguson who lived near Kirkcaldy in Fife, and so Leslie in turn became friendly with the wealthy Ferguson family. This friendship proved useful for Leslie who some 25 years later would conduct experiments at the home of the Ferguson brothers. In particular Leslie constructed a machine to make ice in their home at Raith, near Kirkcaldy.
In 1785 Leslie went to the University of Edinburgh, matriculating as a divinity student. In the same year Playfair was appointed Professor of Mathematics at Edinburgh and Leslie became far more interested in attending classes in mathematics and science than he was in divinity lectures. He attended mathematics lectures by Playfair, science lectures by Joseph Black (a chemist who had discovered latent heat in 1761), Alexander Monro (a physician who held the chair of anatomy) and John Robison, and philosophy lectures from Dugald Stewart (son of Matthew Stewart and holder of the chair moral philosophy). In 1787 the Principal of the University of St Andrews died and Leslie no longer felt obliged to follow the conditions of his scholarship which required him to join the Church of Scotland. Instead he decided that he wanted to teach mathematics and Adam Smith (the philosopher and political economist) obtained a position for Leslie as a tutor to one of his relations. He took on other pupils too and in 1788 he sent his first paper to the Royal Society of Edinburgh.
Soon after this Leslie became tutor to Thomas Randolph who was a student at Edinburgh but was from Virginia in North America. Leslie, with strong recommendations from his lecturers at Edinburgh, obtained a position to tutor both Thomas and his brother William and he sailed to Virginia in 1888 to take up this position. However the Randolph family broke up after the boys' mother died and Leslie returned to Scotland in 1889. Hoping to improve his prospects of a job after being unsuccessful in Scotland, he went to London but, for a while, Leslie struggled to obtain a job there. He was unsuccessful in finding positions as a tutor, or as an assistant to the astronomer royal, or as a lecturer in natural philosophy. He even considered joining the Church of Scotland which he had rejected several years earlier. However he was appointed as tutor to the Wedgwood family in 1790 and held this position until the end of 1792. At this point he travelled back to Scotland and was based in his home town of Largo until 1805.
During these years in Largo he made some money, as he had during his time in England, writing literary articles for publications such as the Monthly Review. He wanted badly to get a university position and, during these years in Largo, two possible chairs fell vacant. Both were in natural philosophy with one being at St Andrews and the other at Glasgow. The problem was that at Scottish universities (particularly St Andrews) chairs were largely political appointments but also the Church of Scotland had a major influence. Leslie did not support the correct political party and by this time the young man who had come close to joining the Church had practically become an atheist. However his luck changed in 1797, for in that year Thomas Wedgwood, who had earlier tutored, gave him a pension for life and his future became financially secure. This was the opportunity that Leslie needed to allow him to concentrate on his mathematical and scientific researches. His publications on heat, culminating in Experimental Enquiries into the Nature and Properties of Heat (1804) led to him being awarded the Rumford medal of the Royal Society of London in the following year.
After two further unsuccessful attempts at chairs of natural philosophy (one in St Andrews and one in Edinburgh) he was appointed as professor of mathematics at Edinburgh in 1805 after a bitter dispute, since he was not ordained by the Church. The story of this controversy is told in  and it is an interesting one since it revolves round whether the Church could control the scientific views taught in the universities:-
Before his election the Edinburgh moderates had insinuated that Leslie was an atheist. They adduced note xvi of his Heat in which he had written favourably about the doctrine of the sceptical David Hume that causation was nothing more than an observed constant and invariable sequence of events. When they brought forward their own candidate, Thomas MacKnight, an Edinburgh clergyman, Dugald Stewart and Playfair protested against the uniting of clerical and academic posts and objected to the intended clerical domination of the University of Edinburgh on the pattern of St Andrews. After Leslie's election the Edinburgh moderates, determined to oust Leslie, took the affair to the general assembly of the Church of Scotland, its highest forum, which decided in May 1805 by the narrow majority of 96 to 84 that the affair be dropped and Leslie be left undeposed from his mathematics chair.
Leslie was a successful professor of mathematics, attracting large classes of students and publishing his lectures in popular textbooks such as the three part work Elements of Geometry, Geometrical Analysis, and Plane Trigonometry (1809). He mixed classical mathematical teaching with some new continental approaches to analysis and algebra particularly in his advanced classes. Leslie became professor in Natural Philosophy in 1819 after the chair fell vacant on Playfair's death. This was not without a battle, for again the Church put up a candidate but, having won a victory in the earlier encounter, this time proved much more straightforward. He gave courses which were filled with experiments on specially made apparatus, for which Leslie himself had paid over half the cost from his own pocket. He soon discovered that one of the main problems of teaching university level physics was the lack of mathematical background of most of his students. He wanted to rectify this by teaching mathematics courses specially tailored for his physics students, but the University of Edinburgh senate prevented him from giving such courses since these topics were deemed the responsibility of the professor of mathematics.
Leslie was elected a fellow of the Royal Society of Edinburgh in 1807, a Corresponding Member of the French Academy of Sciences in 1820, and was knighted in 1832. Rather remarkably he asked for the knighthood which was conferred on him, writing to the Lord Chancellor in September 1831 :-
My present claim is very moderate; but from a liberal ministry, I might even look for some honourable mark of respect. ... Through the manoeuvrings of our Principal, a knighthood was conferred on the Regius Professor Ballingall ... assuredly the least prominent of our body. ... Now on the occasion of the approaching coronation ... ministers may have the opportunity of counterpoising the inconsiderate act of their predecessors. It would become a liberal government to show their estimation of Wiggery and Science. In that case, I might without vanity say that ... the public voice would name myself.
He published 10 books, many journal papers and several encyclopaedia articles in Encyclopaedia Britannica. Craik writes in :-
John Leslie's versatile but undisciplined intellect was more suited to invention and speculation than to logical analysis. As well as writing textbooks on mathematics and works on natural philosophy, Leslie anonymously translated Buffon's multivolume "Natural History" ..., contributed to a popular work on polar travel, and wrote for the Scottish-based "Edinburgh Encyclopaedia" and for the "Encyclopaedia Britannica".
Leslie is described in  in colourful terms:-
In later life Leslie was not prepossessing in his appearance. Lampooned in a student magazine as Edinburgh's Falstaff, he was short and fat with a florid face, his front teeth projected, and he tottered when walking. A strong and active man, he ate big meals at the end of which he was capable of devouring 2 pounds of almonds and raisins. He dressed slovenly but, in an attempt to appear engaging, the affluent and vain but grubby bachelor dyed his hair purple. His great intellectual powers were combined with a love of financial reward which even his friends thought unseemly. ... In his private life ... he was a warm friend, a reliable relative, free from that affectation so characteristic of his literary style, and above all placable.
Leslie, who owned a townhouse in Edinburgh with fine library and beautiful paintings, purchased in addition an estate at Coates which is east of Largo, set back from the Fife coast but with a fine view over the Firth of Forth. In the autumn of 1832 he caught a severe cold which became a fever when he did not look after himself. He continued to work outside in the cold winter weather, organising improvements to his estate at Coates, and he died after the fever worsened.
Article by: J J O'Connor and E F Robertson