After showing that complex numbers are couples of real numbers and that their multiplication rotates the plane, Hamilton wanted to do the same in space. He was looking for triplets $a + bi + cj$ with a multiplication that respected the law of the moduli: the size of the product should be the product of the sizes. He tried for years, above all in 1843, so much so that his children asked him every morning whether he could multiply triplets yet.

Why three will not do

There is an obstacle hidden in arithmetic. If there were a rule for multiplying triplets with the law of the moduli and with integer coefficients, the product of two sums of three squares would always be a sum of three squares. But

$$3 = 1^2 + 1^2 + 1^2, \qquad 5 = 2^2 + 1^2 + 0^2, \qquad 3 \times 5 = 15,$$

and $15$ is not a sum of three squares (try it: the squares available are $0, 1, 4, 9$, and no combination of three gives $15$). With four squares the difficulty vanishes: $15 = 9 + 4 + 1 + 1$. And since 1748 Euler’s four-square identity had been known, saying that the product of two sums of four squares is always a sum of four squares. Nature seemed to ask for four parts, not three.

The walk

On 16 October 1843, a Monday, Hamilton was walking with his wife from Dunsink into Dublin, along the Royal Canal, to preside over a meeting of the Royal Irish Academy. He told the scene to his son himself, twenty-two years later:

Although she talked with me now and then, yet an under-current of thought was going on in my mind, which gave at last a result, whereof it is not too much to say that I felt at once the importance. An electric circuit seemed to close; and a spark flashed forth. […] Nor could I resist the impulse — unphilosophical as it may have been — to cut with a knife on a stone of Brougham Bridge, as we passed it, the fundamental formula with the symbols, i, j, k.

— William Rowan Hamilton, letter to his son Archibald (1865)

The formula was

$$i^2 = j^2 = k^2 = ijk = -1.$$
The plaque on Broom Bridge (formerly Brougham Bridge), in Dublin: “Here as he walked by on the 16th of October 1843 Sir William Rowan Hamilton in a flash of genius discovered the fundamental formula for quaternion multiplication i² = j² = k² = ijk = −1 & cut it on a stone of this bridge”.
The plaque on Broom Bridge (formerly Brougham Bridge), in Dublin: “Here as he walked by on the 16th of October 1843 Sir William Rowan Hamilton in a flash of genius discovered the fundamental formula for quaternion multiplication i² = j² = k² = ijk = −1 & cut it on a stone of this bridge”.Cone83 · Wikimedia Commons · CC BY-SA 4.0

The multiplication table

A quaternion is $q = a + bi + cj + dk$, with four real numbers. Every product follows from the formula on the bridge. Multiplying $ijk = -1$ on the right by $k$: $ijk^2 = -k$, that is, $-ij = -k$, and so $ij = k$. In the same way:

$$ij = k, \quad jk = i, \quad ki = j, \qquad ji = -k, \quad kj = -i, \quad ik = -j.$$

Here is the daring part: $ij = k$, but $ji = -k$. The order of the factors changes the product. Since antiquity every known number had obeyed $ab = ba$. Hamilton was the first to build, deliberately, a useful algebra in which this fails, and he paid that price for a reward: the law of the moduli holds. For $q = a + bi + cj + dk$ the size is $\lvert q \rvert = \sqrt{a^2 + b^2 + c^2 + d^2}$, and

$$\lvert pq \rvert = \lvert p \rvert\,\lvert q \rvert.$$

It is exactly Euler’s four-square identity, now with an algebraic meaning.

Broom Bridge over the Royal Canal in Dublin, seen from the towpath along which Hamilton walked in 1843. The original carving vanished long ago; the present plaque dates from 1958.
Broom Bridge over the Royal Canal in Dublin, seen from the towpath along which Hamilton walked in 1843. The original carving vanished long ago; the present plaque dates from 1958.Johnflan · Wikimedia Commons · CC BY-SA 4.0
Exercise: order matters

Compute $(1 + i)(1 + j)$ and $(1 + j)(1 + i)$.

$(1 + i)(1 + j) = 1 + j + i + ij = 1 + i + j + k$. $(1 + j)(1 + i) = 1 + i + j + ji = 1 + i + j - k$. The two products differ only in the sign of $k$, but they differ. In both the size is $\sqrt{4} = 2 = \sqrt2 \cdot \sqrt2$, as the law of the moduli requires.

Exercise: deducing jk = i

From $i^2 = j^2 = k^2 = ijk = -1$, show that $jk = i$.

Multiply $ijk = -1$ on the left by $i$: $i^2 jk = -i$, that is, $-jk = -i$, and so $jk = i$. Notice that one had to multiply on the correct side: in a non-commutative algebra, multiplying on the left and on the right are different operations.

Sources: William Rowan Hamilton, letter to Archibald Hamilton (1865), in R. P. Graves, Life of Sir William Rowan Hamilton, vol. 2 (1885) · William Rowan Hamilton, Lectures on Quaternions (1853) · John Baez, “The Octonions”, Bulletin of the AMS (2002) · Hamilton’s biography, MacTutor.


All topics on William Rowan Hamilton · ← Hamilton’s mechanics · Rotating in space with quaternions →

Image credits.