Multiplying Quaternions

No-one has really explained how to do this yet. We'll be working with the two quaternions:
A = a + bi + cj + dk
E = e + fi + gj + hk
As has already been mentioned, multiplying quaternions is non-commutative, and multiplying the units is actually anti-commutative. This means we have to be extra careful. So then:

AE = (a + bi + cj + dk)(e + fi + gj + hk)

Now we have to laboriously expand these brackets, being very careful not to change the order of the units as we go:

ae + afi + agj + ahk
+bei + bfi² + bgij + bhik
+cej + cfji + cgj² + chjk
+dek + dfki + dgkj + dhk²

Currently we have a lot of unresolved units all over the place, so let's tidy them up using Hamilton's Laws:

ae + afi + agj + ahk
+bei - bf + bgk - bhj
+cej - cfk - cg + chi
+dek + dfj - dgi - dh

Lovely, right right? Now we just need to group together the terms with the same unit:

ae - bf - cg - dh
+i( af + be + ch - dg )
+j( ag - bh + ce + df )
+k( ah + bg - cf + de )

And there you have it.
Corrections to the normal address.