Professor William Gregory died in Edinburgh in April 1858, and was honoured with a public funeral.

He was succeeded in the university by Dr Lyon Playfair (afterwards Lord Playfair) who had contested the chair unsuccessfully at the time of Gregory’s appointment.

William Gregory was survived by an only son, who was called after his father’s far-famed friend, James Liebig Gregory.

Duncan Farquharson Gregory was considerably younger than his brother the Professor of Chemistry, and was not at all like him in personal appearance. His face was a beautiful one, fine, pale, bearing on it already in this life some of the light and joyousness that often mark out for especial love those who are to pass quickly from this earth. His hair, which was thick and curling, fell more about his brow than is usual, and his eyes like dark lamps illuminated his features.

When he was hardly more than a baby, his father used fondly to predict distinction for him. ‘He had pleasure in conversing with him as with an equal on subjects of History and Geography,’ so Mr Ellis wrote, and this when the boy was not more than six, for his father died before he had left the nursery. He was a great inventor of games for himself, and made an orrery with his busy little hands, on which he would send the planets spinning round in their orbits.

Till he was nine years old he was taught entirely by his mother, who was quite as attractive to her children as she had ever been in society, and for whom Duncan had always a peculiar reverence and affection. He passed out of her hands into the care of a tutor, and then was sent to the Edinburgh Academy. From school he went abroad to Geneva, where his mother and sisters were spending a winter, and on his return he attended classes at the University of Edinburgh. In mathematics he made astonishing strides, under Professor Wallace, and those who saw the master and pupil together in Cambridge in after days, said that the old man’s pride in his pupil’s success never diminished.

In 1833 Mr Gregory’s name was entered at Trinity College, Cambridge, and shortly afterwards he went to reside there. He took with him a most unusual amount of knowledge on almost all scientific subjects, in fact many men said that it was the diffuseness of his learning that prevented him from taking the first place in the mathematical honours in that university; for when the tripos came he was only fifth wrangler.

A few months after his arrival in Cambridge he agreed to act as assistant to the Professor of Chemistry, and he was one of the founders of the Chemical Society, and occasionally gave very charming lectures in their rooms. His other pursuits were botany, natural philosophy, and astronomy, but his most serious study was of course mathematics.

After taking his degree of B.A. in 1837, he felt himself more at liberty to follow original speculation, and turned his attention to the general theory of the combination of symbols. His studies in this subject appeared from time to time in the Cambridge Mathematical Journal, of which Duncan Farquharson Gregory was editor, with only an interval of a few months, from its first appearance till shortly before his death.

Mr Gregory was in 1840 elected a Fellow of Trinity College, and he took his M.A. degree in the following year. In that year, too, he was appointed to fill the office of moderator in the Mathematical Tripos. This position, which is regarded as one of the most honourable of those to which the younger members of the university may aspire, was filled by him with great success.