Mad Teddy's web-pages
FURTHER QUATERNION STUFF
(and a brief look at other number systems with even more dimensions)
Page 1
of this set of three web-pages presented a background to the real number
system that we all learned in school, and then progressed to some of the
basic properties of complex numbers. The fact that both real and complex
numbers form fields was mentioned, along with the fact that the
multiplication of complex numbers can be seen to have a natural connection
with rotation in the Argand plane.
Page 2
recounted the story of the discovery, in 1843, of the quaternions by Sir
William Rowan
Hamilton
- and then went on to give a reasonably in-depth discussion of the basics
how they "work", with particular emphasis on the fact that multiplication is
not commutative, so that they form a (strictly) skew field. (I also growled
about how I think that the over-formal way in which mathematics and science
are often presented has caused a lot of damage from an educational point of
view.
The application of quaternions to computer animation was mentioned, along
with the fairly recent suggestion that restoring the original quaternionic
nature of Maxwell's electromagnetism equations may well have some extremely
significant consequences for technology (and a whole lot more besides). In
this connection, the concept of vectors was mentioned very briefly.
Along the way, the surprising fact that (in quaternion terms) negative real
numbers have infinitely many square roots was raised. Hamilton's
letter
to his friend John T. Graves was mentioned in this connection.
In this, the third page, I'll develop the matter of square roots further
(just because it is so intriguing, basically!), and briefly introduce
the last of the four "normed division algebras" (the octonions), and
also something called the biquaternions!
SQUARE ROOTS
Toward the end of Hamilton's letter to John Graves (mentioned above), he
gives a formula involving a square root. It's not clear (at least, not to
me) how he obtained this; but at some point I decided to try to work out,
from first principles, my own general expression for the square root of a
quaternion - and that formula appeared in my result.
I'll give my working shortly; but first, by way of motivation (and I'm sure
that by now you know that I'm big on motivation), let's look at the simpler
problem of finding a general formula for the square root of a complex
number.
SQUARE ROOT OF A COMPLEX NUMBER
The aim of the following exercise is to find a general formula for the
square root of the general complex number, x + yi , where x and y are both
real.
Note: we can always put a complex number into its polar form (see
page 2),
and find its "principal" square root by taking the square root of its
modulus and halving its argument; but here, we'll concentrate on doing it
algebraically.
Suppose that p + qi , where p and q are also both real, is such a square
root. Then
(p + qi)2 = x + yi
, therefore
p2 + 2pqi -
q2 = x + yi
Equating real coefficients and imaginary coefficients, we obtain
p2 -
q2 =
x and 2pq = y
From the second of these, we obtain q = y/2p . Substituting this into the
first:
p2 -
y2/4p2
= x , therefore 4p4 -
4p2x -
y2 = 0
This can be considered as a quadratic equation in
p2. Quartic equations of this type, in
which linear and cubic terms are absent, are sometimes called
biquadratic. It's possible to solve them by using the quadratic
formula as a first step, as follows:
p2 = [4x ±
sqrt(16x2 +
16y2)]/8 =
[x ± sqrt(x2 +
y2)]/2
Note that we are using "sqrt" as an abbreviation for "square root of".
Now, since we are insisting that p must be real, and since [x -
sqrt(x2 +
y2)] must be negative (unless y = 0, in
which case the value of this expression will also be 0), we can simply drop
the "-" from the "±". Then, taking square roots:
p = ±sqrt[x + sqrt(x2 +
y2)] / sqrt(2) or p =
±sqrt[sqrt(x2 +
y2) + x] / sqrt(2)
Next, substitute this into q = y/2p :
q = y × sqrt(2) / {±2 × sqrt[sqrt(x2 +
y2) + x]}
= ±y / {sqrt[sqrt(x2 +
y2) + x] × sqrt(2)}
Multiplying both the top and bottom of this fraction by
sqrt[sqrt(x2 +
y2) - x] :
q = ±y × sqrt[sqrt(x2 +
y2) - x] /
{sqrt[x2 +
y2 -
x2] × sqrt(2)}
= ±y × sqrt[sqrt(x2 +
y2) - x] /
{sqrt[y2] × sqrt(2)}
= ±y × sqrt[sqrt(x2 +
y2) - x] /
{y × sqrt(2)}
STOP RIGHT THERE!
That last step is not quite correct. Can you see why?
When we take the square root of y2,
it's reasonable to expect that the answer will be y. What else would it be?
When we talk about the "square root" of a (positive) number, it's understood
that we're referring to the positive square root. For example, the
"square root of 49" is 7, rather than -7 (even though they are both square
roots of 49, since the square of each is 49).
If we were to use this process in a particular case with actual numbers for
the coefficients, there'd no confusion. However, when we use algebraic
symbols (pronumerals) to stand for coefficients in fully-general formulas,
as in our case here, we have to be careful.
In the development of our square root formula, y could be positive or
negative (or zero). If it's negative, we need to be aware that the
positive square root of y2 is
-y, not y.
To cut a long story as short as possible, and basically to "make things
work", what we can do here is put y in the denominator - as we've done - but
then also multiply the entire term by the "signum function", sgn(y). This
takes the value 1 if y is
positive, -1 if it's negative,
and 0 if it's zero.
This fixes everything so that the formula will give us correct answers, no
matter what the value of y is.
Okay - let's rewrite that last line with the corrrection, and continue:
... = ±y × sqrt[sqrt(x2 +
y2) - x] /
{y × sqrt(2)} × sgn(y)
therefore q =
±sqrt[sqrt(x2 +
y2) - x] / sqrt(2) × sgn(y)
So, finally, the two square roots of x + yi are
±{sqrt[sqrt(x2 +
y2) + x] +
sqrt[sqrt(x2 +
y2) - x]×sgn(y) i} / sqrt(2)
Well, it's a bit tedious getting there; but the final formula itself isn't
really all that complicated - and it does work! For example, it gives the
square roots of 3 + 4i as ±(2 + i) . [You can check this by calculating
(2 + i)2.] Also, significantly, it
gives the square roots of 3 - 4i as ±(2 - i), rather than as ±(2 + i), which
it would give if we didn't include the sgn(y) in the expression!
Make up some examples of your own: choose some complex number, square it,
and then use this formula to find the square roots of the result. You'll
find that it always gives correct answers.
Note that the two square roots of any complex number are opposite each
other with respect to zero in the Argand plane, corresponding to an
anticlockwise rotation of 180 degrees as a result of multiplying by -1 , or,
indeed, to a clockwise rotation of 180 degrees as a result of dividing by
-1 (take your pick!). Thus, following the examples just given, the two
square roots of 3 + 4i , i.e. 2 + i and -2 - i , are located 180 degrees
apart, on opposite sides of the origin; similarly for the two square roots
of 3 - 4i , i.e. 2 - i and -2 + i .
SQUARE ROOT OF A QUATERNION
Following the same basic idea as for finding the square root of a complex
number (above), let's now attempt to produce a formula for the square root
of the general quaternion, w + xi + yj + zk , where w, x, y, and z are all
real numbers.
Suppose that p + qi + rj + sk is such a square root (with p, q, r, and s all
real numbers); then
(p + qi + rj + sk)2 = w + xi + yj + zk
We have no choice but to multiply the left-hand side out. (Sorry!)
p2 + pqi + prj + psk +
pqi - q2 + qrk - qsj +
prj - qrk - r2 + rsi +
psk + qsj - rsi - s2
= p2 -
q2 -
r2 -
s2 + 2pqi + 2prj + 2psk
Well, it could be worse. So:
p2 -
q2 -
r2 -
s2 + 2pqi + 2prj + 2psk
= w + xi + yj + zk
Equating coefficients:
p2 -
q2 -
r2 -
s2 =
w
2pq = x
2pr = y
2ps = z
The last three of these give
q = x/2p
r = y/2q
s = z/2p
which we can substitute into the first one:
p2 -
x2/4p2 -
y2/4p2 -
z2/4p2 = w
, therefore
4p4 -
(x2 +
y2 +
z2) =
4wp2
or
4p4 -
4wp2 -
(x2 +
y2 +
z2) = 0
(Note the similarity of this biquadratic equation to the corresponding
equation in the complex case, above.)
Treating this as a quadratic equation in
p2 , and applying the quadratic
formula:
p2 =
{4w ± sqrt[16w2 + 16(
x2 +
y2 +
z2)]} / 8
= {w ± sqrt[w
Quaternions: an old (and new) look at four dimensions - page 3
)
-
and maybe raise a bit of hell about a few other things too, while we're at
it.