Thomas Carlyle is best known as an writer but in fact was also a mathematician. His father, James Carlyle, was a stonemason and his mother, Margaret Aitken, the daughter of a bankrupt Dumfriesshire farmer, was James' second wife. James had married Jannet but she died after the death of their son John in 1791. James and Margaret married in 1794 and Thomas was the eldest of their nine children. Although James and Margaret were intelligent people they were not well educated and Margaret, for example, could read only with difficulty and could not write at the time of her marriage. They were very religious people and they brought up their family to strict Calvinist principles teaching them frugality and discipline. Thomas first learnt basic arithmetic from his father.

Thomas attended the village school at Ecclefechan until he was six years old and then Hoddam parish school until he was ten years old. He was also taught Latin privately by a local minister so he was well prepared for his secondary schooling. However Annan Academy was six miles away and Thomas's mother did not want him to attend the school. His father, however, insisted and on 24 May 1806 he accompanied his ten year old son on the six mile walk to the Academy where Thomas became a boarder during the school week returning home for the weekends. He excelled academically at Annan Academy, showing particular aptitude for mathematics, but his school days proved difficult and unhappy. His mother told him that he must never use physical force even to defend himself and this, rather naturally given the conditions in the school, meant that he was badly bullied. Eventually he went against his mother and fought back, which certainly made his life more bearable. His teachers provided efficient but uninspiring education which was aimed at making pupils ready to enter university by the age of fourteen. In addition to mathematics, his best subject, he had also enjoyed studying modern languages at school. Almost certainly he had learnt more from studying books on his own than he had from the somewhat second rate teachers.

Carlyle entered the Edinburgh University in November 1809 where his parents expected him to train to enter the ministry. The university was eighty miles from Ecclefechan and Carlyle said goodbye to his parents on the edge of his home town then walked the eighty miles during the following three days. Arriving at Edinburgh University he matriculated and began the four year course leading to an M.A. with the prospect of a further three years after that to train for the Church. As all students did, he studied a general course not specialising in any particular topic although he showed particular promise in mathematics. In his first year he was somewhat withdrawn as he had been at school but by his second year he had become more confident, and was making friends with his fellow students. He was described by a fellow student while in his second year as:-

... distinguished ... by the same peculiarities that still mark his character - sarcasm, irony, extravagant sentiment, and a strong tendency to undervalue others, combined however with great kindness of heart and great simplicity of manner.

He was, however, inspired by the mathematics teaching of Leslie but one would have to say that his opinions of most of his other lecturers was poor to say the least.

In November 1813 he completed his M.A. course but, like many students at this time, chose not to graduate. He enrolled in Divinity Hall of the Church of Scotland in Edinburgh for his divinity training, but as his parents could not afford to have him study full time for three years, he chose the option of one year of full time study followed by six years part-time study during which he had to return to Edinburgh and preach a trial sermon once a year for each of the six years. Carlyle completed the one year of full time study but did not enjoy it. During this year he maintained his mathematics interest by publishing articles in newspapers and greatly enjoyed entering into controversial intellectual discussions. He left Edinburgh in June 1814 and returned to Annandale. With a strong recommendation from Leslie, he was appointed as a mathematics teacher at Annan Academy [3]:-

From the start Carlyle anticipated that he would dislike teaching. Moreover, he had to face the irony that Annan Academy was where he had been unhappy for most of his schooldays.

In 1816 he moved to another school, again as a mathematics teacher, this time in Kirkcaldy. At least this had the advantage he could get easily to Edinburgh by taking a ferry ride across the Forth. His life was made harder since around this time his mother had a severe mental illness. He continued to study mathematics on his own and in 1816 he tried to read Newton's Principia but finding this difficult he read Delambre's Abrégé d'astronomie then returning to the Principia with more success. He continued his part-time divinity training and returned to Edinburgh to give a trial sermon on the text "Before I was afflicted I went astray". In 1817 he tried to understand the Continental approach to the calculus by reading Wallace's article Fluxions which was published in the Edinburgh Encyclopaedia in 1815 and used Leibniz's differential notation. Again he found it difficult and, discovering his mathematical limitations, he began to lose his enthusiasm for the subject. He wrote to a friend in November 1817 [11]:-

[Geometrical problem solving] depends very much upon a certain slight of hand, that can be acquired without great difficulty by frequent practice - I am not so sure as I used to be that it is the best way of employing one's self - without doubt it concentrates our mathematical ideas and exercises the head; but little knowledge is gained in the process.

Unhappy with teaching, Carlyle resigned from his post in Kirkcaldy in 1818, and returned to Edinburgh University. Leslie, seeing that despite being a very competent mathematician, he would never excel at research, advised him to use his mathematical skills by studying engineering and then suggested that he should go to the United States. Carlyle chose not to follow Leslie's advice but, despite making a little money as a mathematics tutor, he was in severe financial difficulties. He made an attempt to study law taking some classes in 1819 but soon discovered that this was not to his liking. He spent three unhappy years in Edinburgh, eventually deciding that he would change direction again. He began a serious study of German and he turned to history and literature for which he is famed. In mathematics Carlyle is famed for his English translation of Legendre's Eléments de géométrie which David Brewster commissioned him to undertake for £50 in 1821. This translation, which first appeared in 1824, ran to 33 editions.

Carlyle held a number of posts as a tutor after leaving Edinburgh University, having no fixed base. In 1821 he met Jane Baillie Welsh whose father John Welsh had been a respected Haddington doctor but had just died of typhoid. Jane was nineteen years old at the time and her mother Grace Welsh was finding things very difficult. Carlyle was soon sending Jane letters showing his affection, but she found it hard to imagine that she might ever marry. However she wrote to Carlyle, going against her mother's wishes in doing so [3]:-

Despite Jane's warning that he would repent of it, Carlyle went to Haddington the first weekend in February 1822. The visit was a painful disaster: both mother and daughter resented the brash appearance of a young man who did not qualify as a suitor and who was too assertive to be welcomed as a friend.

Despite little encouragement, Carlyle persisted in his attempts to win Jane over. She worried, however, that she did not love him and she also worried that if they married she would have a much lower standard of living. Carlyle lived for a year at a small isolated farm called Hoddam Hill near the town of his birth. Then, after Jane's mother rented a home on the outskirts of Edinburgh for the couple to live in once they were married, the marriage took place on 17 October 1826.

Several important events happened in the years between Carlyle meeting his future wife and their marriage. One was that, despite his very religious upbringing, he turned away Christianity and became an atheist. He began to write and his first work The Life of Schiller was published in the London Magazine (1823-24), then soon after his translation of Goethe's Wilhelm Meister appears in the same publication in 1824. He had also made a short trip to London in 1824 where he met a number of the leading literary figures at dinners and arranged visits. It was perhaps ironical that the type of mathematics position which would certainly have interested him a few years earlier now came up. He was told that if he applied for the position of Professor of Mathematics at the Royal Military College at Sandhurst in Surrey he was certain of being appointed. However, he felt that his literary career was taking off and that it would be damaged by his holding such a post; he chose not to apply.

In the spring of 1827 Carlyle and his wife began to consider living at Craigenputtoch, a small farm about 20 miles from Dumfries which Jane had inherited from her father. Carlyle still fancied a university post, however, and in May 1827 he wrote an application letter (see [12]):-

I have more than once meditated inquiring of you about that "London university" of yours. I learn from the newspapers that the people have advertised for professors. ... to myself it seems that some moral philosophy or rhetoric professorship there would be no such unhansome appointment. I can teach mathematics also, and physics ... and touches of metaphysics. But the fittest place for me would be that "Jack of all trades" in case they wanted such a hand.

Perhaps not surprisingly this rather strange letter of application did not lead anywhere. It is interesting, however, that even at this stage, Carlyle was still interested in teaching mathematics. Carlyle also applied unsuccessfully for the chair of moral philosophy at St Andrews University, and he even applied for the chair of astronomy at Edinburgh University in 1834.

Carlyle and his wife spent six years living at Craigenputtock, from 1828 until 1834, after which he went to set up home in London. His first major work was the philosophical play Sartor Resartus. He had completed it in 1831 but despite spending several months in London attempting to find a published he failed. He did however publish Characteristics in the Edinburgh Review in 1831. After he moved to London in 1834 he wrote the three volume historical work The French Revolution which brought him both popular and academic fame after its publication in 1837. However writing the work proved very dramatic. After completing the manuscript of the first volume he gave it to his friend John Stuart Mill to read. Somehow the manuscript was mistaken for waste paper and used to kindle of fire. Carlyle had to rewrite the whole volume from memory. He also had Sartor Resartus published in 1838. As well as his historical works Carlyle wrote Chartism (1840) which opposes conventional economic theory.

These works had achieved fame for Carlyle who now received invitations to lecture which solved his financial problems. He gave a series of lectures beginning in May 1837 on the German influence on Britain, and another series in the following year on European literature. Further lectures series were given in 1839 and 1840. His later historical works include The Letters and Speeches of Oliver Cromwell (1845), and the six volume work The History of Friedrich II of Prussia, Called Frederick the Great (1858-1865).

Carlyle became rector of Edinburgh University in 1865 after Gladstone retired from the office. He had been elected by the students in a contest with Disraeli. His installation address On the Choice of Books (1866) was published and its tone of high moral exhortation made it very successful. In fact Carlyle was still at the University following his address when news reached him that his wife had died in London on 21 April.

Though incapable of lying, Carlyle was completely unreliable as an observer, since he invariably saw what he had decided in advance that he ought to see. ... Carlyle was never able to respect ordinary men ... His fierceness of spirit was composed of two elements, a serious Calvinistic desire to denounce evil and a habitual nervous ill temper, for which he often reproached himself but which he never managed to defeat.

Froude, who was a personal friend, sums Carlyle's character up in [6]:-

He was fierce and uncompromising. To those who saw but the outside of him he appeared scornful, imperious and arrogant. He was stern in his judgment of others ... insincerity ... he could never pardon ... He would not condescend to the conventional politenesses ... He called things by their right names, and in a dialect edged with sarcasm ... His temper had been ungovernable from his childhood; he had the irritability of a dyspeptic man of genius ... he who preached so wisely on 'doing the duty which lay nearest to us', forgot his own instructions ... He was always sad: often gloomy in the extreme.