Over the weekend, I read the previous entry on this blog. It’s a post by my ex-PhD Student Emma, who having done a PhD in theoretical nuclear physics here at Surrey, is now working in climate change analysis at the London School of Economics. One shouldn’t really be surprised to find physicists in such places. Partly that’s because the division between disciplines is somewhat artificial. Everything, or at least all science, is connected by underlying principles, and common methods and ways of thinking. This is something to bear in mind when taking a modularised degree programme – you should definitely not assume that forgetting about the contents of one module once you’ve passed the exam is a good idea. Not, at least, if you want to have a holistic view of your subject. Emma working on climate change studies with a physics background is also not surprising since we physicists think we can turn our hand to anything. More often than not with justification.
Anyway, Emma mentioned that I was a “regular” contributor to this blog. I might argue that regular really means at fixed intervals, and that Halley’s comet visits Earth regularly, but I suppose she intended the common usage meaning often. I felt a little guilty, since I don’t post very often, at least not compared to my steadfast colleague Dr Sear. So, I resolved to post, and I thought I’d post about something I’ve learned recently. It’s nothing at all new – a method of finding the roots (zeros) of cubic equations that goes back to at least the 16th Century. I’ve known of its existence, but was prompted to learn it thanks to a Final Year Project student, who came to me with it recently.
Cubic equations are polynomial equations whose highest order is the power of 3 in the unknown quantity. In general they can be written
a·x3 + b·x2 + c·x + d = 0.
In the special case that
a=0 then the equation is (at most) a quadratic, and one can use the familiar quadratic formula to find the roots. The general cubic case is a bit more tricky. To work through an example, I’m going to pick particular values for a, b, c and d. I’ll do it by writing the equation as the product of three terms with known roots (-1, 1 and 1/2):
(x+1)·(x-1)·(2·x-1) = 0
and then expanding to give a cubic whose roots I do know, but with which I can test the general method. The expansion gives
2·x3 - x2 - 2·x + 1 = 0.
The first step is to change the variable. This is done as
y = x + k where k is the coefficient of the squared term divided by three times the coefficient of the cubed term. In my case, k = -1/(3·2) = -1/6. So I have y = x - 1/6, so x = y + 1/6. This can be substituted in the original cubic equation to give
2·(y+1/6)3 - (y+1/6)2 - 2·(y+1/6) + 1 = 0.
The brackets can all be expanded to give:
2·y3 - y2 + 1/6·y + 1/108
+ y2 - 1/3·y - 1/36
- 2·y - 1/3
2y3 - 13/6·y + 35/54 = 0.
This is the reason for the substitution – it exactly removes the squared term. Now we divide the whole equation by 2 to get rid of the coefficient in the leading term:
y3 - 13/12·y + 35/108 = 0.
Now things get a bit strange. From out of nowhere, we make the substitution y = u + v – i.e. we write the unknown variable as the sum of two unknowns u and v. The reason for this becomes clear when we discover the trick later on. If we accept that we make this substitution, then we can work out that y3 is
y3 = (u + v)3 = u3 + v3 + 3·u2v + 3·v2u.
and substituting fully for y in the (quadratic-less) cubic equation gives
u3 + v3 + (3·uv - 13/12)·(u+v) + 35/108 = 0 .
Now the trick is to to say that u and v are not independent variables, as we have created them both from the one unknown y. We are therefore free to link them with any suitable relationship, so we choose that which makes the (u+v) term zero:
3·uv = 13/12.
We can divide by 3 and cube this equation to give
u3·v3 = 133/(3·12)3 = 2197/46656.
That we have set
3·uv - 13/12 = 0 means that
u3 + v3 = -35/108.
Now we have a pair of two simultaneous equations for two unknowns in the variables
v3. Knowing both the sum and the products of our two unknowns means we can immediately say that they are the roots of a quadratic equation. This is true since if we have a quadratic with roots a and b, we can write
0 = (x-a)·(x-b) = x2 - (a+b)·x + a·b
This means that we can write down a quadratic as
t2 + 35/108·t + 2197/46656 = 0.
This can be solved with the usual quadratic formula to give values for u3 and v3:
(u3,v3) = (-35/108 ± √(352/1082 - 4·2197/64456) ) / 2 .
If we take the argument of the square root and simplify all those fractions, we find that it gives -1/12, so the argument of the square root is negative. Curious… Formally though, we could write our solution of the cubic equation, then as u+v, given by
y=3√(-35/216 + √(-1/12)/2) + 3√(-35/216 - √(-1/12)/2).
This is a very strange way of representing the number y=5/6 leading to the correct root x=1. When evaluating the above expression the imaginary parts cancel out. This was the first use of complex numbers in the history of mathematics – in finding the real roots of cubic equations. In the style of annoying textbooks everywhere, I’ll leave the evaluation of the above expression to the reader (perhaps one who will give the answer in the comments?).
The other two roots can now be found by factorizing the cubic to leave a quadratic factor that is easily solved with the quadratic formula.