He studied mathematics under Augustus De Morgan, and botany under John Lindley at University College London.
While there he gave a course of acclaimed public lectures on botany in 1862 and thus started a lifelong friendship with local resident Harry Bolus.
He advised Bolus to take up the study of botany to ease his grief at the loss of his six-year-old son.
For a while, he practised at the Bar and edited a newspaper before becoming the professor of mathematics at the South African College, which later became the University of Cape Town.
The scope of his interests was diverse and ranged from a lecture titled, "The Heat of the Sun in South Africa", in which he pointed out that it must be possible to transform solar energy into mechanical power, to aeronautics, where he was involved in the development of the first aircraft.