Answer
Astronomy was the subject that Hamilton taught as a professor at Trinity College. He was a highly regarded astronomer, making significant contributions to the field. His work on celestial mechanics and the discovery of the Hamiltonian function are among his most notable achievements. Hamilton's passion for astronomy and his ability to convey complex concepts effectively made him an exceptional professor, inspiring generations of students.