He was born at Cambuslang in 1885, and was the second son of John McWhan, headmaster of Cambuslang School. He was educated at Whitehill School, Glasgow, and entered the University of Glasgow as third in the open bursary competition. As an undergraduate he was awarded both the Cleland Gold Medal in the Class of Natural Philosophy and the Cunninghame Gold Medal in the Advanced Honours Class of Mathematics. In 1907 he graduated M.A. with First-Class Honours in Mathematics and Natural Philosophy, and gained the George A Clark Scholarship. Under the inspiration of Professor Andrew Gray his interests lay at this time towards physics and he proceeded to the University of Göttingen with the Scholarship, being the fifth of a series of eight Glasgow graduates to study physics at Göttingen. There under the direction of Eduard Riecke he did experimental work in thermodynamics, for which he was awarded the degree of Ph.D. His years at Göttingen were fruitful and happy, and he represented the University of Glasgow at the bicentenary celebrations of the University of Göttingen in 1937.
In 1910 he was appointed Assistant and in 1913 Lecturer in the Department of Mathematics in the University of Glasgow. From the end of the last war, until he was overtaken by his last illness in January 1943, his work in the Department was confined to the classes for students of Engineering Science. One of the developments which he initiated was a series of voluntary summer courses, begun in 1920, for instruction and practice in graphical and mechanical calculation, nomography and allied topics. Competition for places in these courses was keen and the work of the students was very good.
He was for many years a Member of the Faculty of Engineering and of the Senate. He was a Member of the Edinburgh Mathematical Society, the Mathematical Association, and the Glasgow Mathematical Association, and was elected a Fellow of the Royal Society of Edinburgh in 1921. To the Proceedings of each of these societies he was a contributor.
His interests were almost wholly confined to his work at the University. He was an artist in everything he did there. Every lecture was thoroughly prepared, and no examination paper left his hand until he was satisfied that every question was exactly right. Though for some obscure reason he never sought publication, his lecture MSS were so perfect that they might have been sent to the printer unaltered.
He was scrupulous and very sensitive, always loyal to his intimate friends, a vigorous and tenacious contender for what he believed to be right, and he had the gift of a quiet sense of humour.
He married Winifred Stevens in 1926, and is survived by her and by one son.