Thomas was not yet twelve, when, with his brother William, he was sent on to the University of St. Andrews. At such an age, common enough then in Scotland, boys were incapable of grasping the great aims of a university; and college to them was but an upper school. But the change to the university had at first no effect in mending the idle ways of our student. He was 'volatile, boyish, and idle.' Yet, even from the first, he was noted for strict integrity and warm affection, and in all that he did undertake he was enthusiastic and persevering. It was not till his third session that he became attached to any branch of learning. The science that captivated him then was mathematics. And so ardently did he devote himself to it, that long afterwards, about the time when he left Kilmany, he was familiarly known as 'Mr. Chalmers, the mathematician.' He might have borne the designation to the very end. His mind was fashioned on the mathematical model, taking its stand on realities, the substantial verities of life; striving to explain their relations and applications, and then pressing them with tremendous energy on the hearts and consciences of his fellows. For Professor Brown, his mathematical teacher, he retained through life the warmest regard; and when he died in 1836, he wrote to his widow, that of all his public instructors he was the one that impressed him most, and to whom he owed most in the formation of his tastes and habits, and in the guidance of his literary life.
As the termination of his curriculum in arts drew near, it became necessary that he should choose a profession. Strange to say, although he had no favour either for theology or religion, he had declared from his boyhood for the ministry. Some of the more picturesque sayings of the Bible had taken a remarkable hold of his mind. When but three years old, being missed and sought for, after it had become dark, he was found alone, pacing up and down in the nursery, repeating to himself the words of David, 'O my son Absalom, my son Absalom; O Absalom, my son, my son!' The sister of one of his schoolfellows used to tell of her breaking in on the two, and finding him on a chair, preaching vigorously to his single hearer. It was the soul of the orator asserting itself from the very first.
But when he entered on his theological course, there seemed to be little or no development of the real spirit of the ministry. He was, indeed, full of reverence for truth, and so impatient of anything like double dealing, that when his professor represented that certain doctrines of Calvinism should not be much spoken of, he could not but ask, Why not, if they be true? Throughout his whole life he disliked men who were not above board with everything, and his own regard for truth was transparent to all. For a time his mind was clouded with scepticism. The books that were most useful in restoring his faith were Butler's _Analogy_ and Beattie's _Essay on Truth_. A very remarkable effect was produced on him when, some time after, he became acquainted with Jonathan Edwards on _The Freedom of the Will_. For a time he could neither think nor talk of anything else. What so impressed him was the idea of the whole series of events in the spiritual as well as the material world being bound together by unalterable links, and thus forming one vast scheme--a wonderful tribute to the wisdom, power, and glory of God. The incident showed how his mind had expanded, and how he had come to find delight in large, comprehensive views of things. Long after, he spoke of the year in which this subject occupied him as a time of mental elysium, so great was his delight. Yet at this time evangelical truth was positively rejected. We are reminded of the experience of another, afterwards a colleague of his own in New College, Edinburgh, the late Dr. John Duncan, who, even when a student of divinity, wandered for a time in the gloomy mazes of atheism, but when brought into the light of theism--apart from Christianity altogether--expressed his emotion in a way of his own: 'I danced on the brig o' Dee when I came to see there was a God.'