Hamilton was born in Dublin, and showed himself to be a child prodigy. He studied both classics and science at Trinity College, Dublin, and was appointed Professor of Astronomy at the university in 1827, even before he graduated.
He discovered quaternions in 1843. Hamilton was looking for ways of extending complex numbers (which can be viewed as points on a plane) to higher spatial dimensions. He could not do so for 3 dimensions, but 4 dimensions produce quaternions. According to a story he told, he was out walking one day with his wife when the solution in the form of the equation i2 = j2 = k2 = ijk = -1 suddenly occurred to him; he then promptly carved this equation into the side of the nearby Brougham bridge.
Hamilton proceeded to popularize quaternions with several books, the last of which, Elements of Quaternions, was published shortly after his death.
Hamilton also contributed an alternative formulation of the mathematical theory of classical mechanics. While adding no new physics, this formulation, which builds on that of Joseph Louis Lagrange, provides a more powerful technique for working with the equations of motion. Both the Lagrangian and Hamiltonian approaches were developed to describe the motion of discrete systems[?], were then extended to continuous system[?] and in this form can be used to define fields. In this way, the techniques find use in electromagnetic, quantum and relativity theory.
He also introduced 'Hamilton's puzzle' which can be solved using the concept of a Hamiltonian path.