Alon Amit on Quora · 2013-09-19

How can I solve an equation of the third degree?

There is more than one way to interpret "solve" in the context of equations in general, and polynomial equations in particular. In practice, most often you would solve a cubic equation (3rd degree) by guessing one solution x_1, dividing the cubic by x-x_1 and then solving the resulting quadratic equation (2nd degree) as usual.

You can also solve any such equation numerically, for example using Newton's method.

However, when people talk about "solving an equation of the 3rd degree", they usually mean a solution by radicals. This means a way to write the three solutions as expressions involving the coefficients of the original equation, square roots, cubic roots, and arithmetic operations. The quadratic formula

x_{1,2} = \frac{-b \pm \sqrt{b^2-4ac}}{2a}

is, famously, a way to express the roots of the quadratic equation ax^2+bx+c=0 in this way.

Why should anyone care?


Honestly, cubic equations aren't that important. They do occur here and there "in real life" and in abstract math, but they're not really fundamentally vital. However, the method of solution has tremendous historical importance and considerable beauty, and therein lies its real value.

It's amazing that mankind attempted to solve cubic equations for thousands of years, eventually succeeding after the dedicated efforts of countless people, yet so few today - even those with considerable mathematical training - are able to remember the algorithm well enough to be able to use it or explain it on demand, without looking it up. This was one of the key intellectual achievements of the renaissance, a significant breakaway from the frontiers of classical knowledge, and I think it deserves to be better known.

It's not really that difficult, anyway. Ready?

The Classical Approach


We're trying to solve an equation that looks like ax^3+bx^2+cx+d=0 where the coefficients a,b,c,d are some numbers. In fact, I'm going to focus on what seems like a very special case:

(1) x^3 + cx + d = 0 .

The reason for this focus is that reducing a general cubic to this form is fairly straightforward, so I'll leave this to the end. The real gem is this special case.

You can play around with this equation for days and months to no avail - the algebraic manipulations we know and love just don't do anything here. The crucial idea is to perform a daring gambit, replacing the single unknown x with a sum of two unknowns p, q. So we just boldly write x=p+q.

How can this be a good thing? We need to determine one number x, and now we have two unknowns to deal with? Well, sure, but we also have a new degree of freedom - we can impose another condition on p and q while allowing them to still add up to x. Maybe that'll save us (hint: it does). This is the only part of the solution that you need to pull out of a hat. The rest is algebra.

Let's put that p+q in our equation to be solved (1). We get

(p+q)^3 + c(p+q) + d = 0

Expanding the cube, this is

p^3 + q^3 + 3p^2q + 3pq^2 + c(p+q) + d = 0.

We leave the cubes alone but observe that there's another p+q hiding in the mixed terms:

p^3 + q^3 + 3pq(p+q) + c(p+q) + d = 0.

We see a repeated term p+q, so we naturally collect the terms that contain it:

p^3 + q^3 + (3pq+c)(p+q) + d = 0.

Now comes the kicker: remember that extra degree of freedom we have? We can use it to eliminate this whole mess in the middle. Quite simply, we nonchalantly impose that 3pq+c is to vanish.

3pq+c = 0

Or:
(2) q = -\frac{c}{3p}.

Our equation is now:

p^3 - \frac{c^3}{27p^3} + d = 0.

And we're done!!

Wait. Why are we done?

Well, if you've solved many high-school quadratic exercises, you may recognize that the last equation is merely a quadratic in disguise. There's only one variable now, and that is p. It only appears in the equation as p^3, so we might as well call z = p^3 and get

z - \frac{c^3}{27z} + d = 0

or

z^2 + dz - \frac{c^3}{27}= 0,

A measly quadratic. Solve it, find the possible values of z, infer the possible values of p (including the complex ones!), determine q (remember equation (2)), and add them up to get x.


TADAAA!!!

A Worked Example


Let's try to go through those steps with a concrete equation:

x^3 - 7x + 6 = 0 .

Once again, the way you really solve this is by guessing a solution (quite easy in this case), eliminating that solution and solving the quadratic. Takes about 2 minutes here. But no - we're going to follow the recipe. It's going to be way harder, introducing complex numbers along the way, but the beauty of it is that it's a recipe, requiring no guesses and guaranteed to work. Always.

So, we make x=p+q,

p^3+q^3+3p^2q+3pq^2 - 7(p+q) + 6 = 0

p^3 + q^3 + 3pq(p+q) - 7(p+q) + 6 = 0

p^3 + q^3 + (3pq-7)(p+q) + 6 = 0

We now declare that

3pq = 7, or

q = \frac{7}{3p}

getting

p^3 + \frac{343}{27p^3} + 6 = 0

or, letting z = p^3,

z + \frac{343}{27z} + 6 = 0

z^2 + 6z + \frac{343}{27} = 0

This is somewhat hairy, but we plow through and find

z = -3 \pm \frac{10\sqrt{3}}{9}i.

The next task is to find the ps which correspond to each of those zs. This is a matter of extracting cube roots of a complex number, a tricky but not insurmountable task. Let's find the cube roots of the one with the + sign (it turns out that this is enough - repeating the task for the other value will yield the same roots again). They are:

p_1 = -\frac{3}{2} + \frac{\sqrt{3}}{6}i

p_2 = \frac{1}{2} - \frac{5\sqrt{3}}{6} i

p_3 = 1 + \frac{2\sqrt{3}}{3} i

For each of these, we calculate q = 7/(3p), addp+q and find the values of x, which turn out to be...

x_1 = p_1 + \frac{7}{3p_1} = -3

x_2 = p_2 + \frac{7}{3p_2} = 1

x_3 = p_3 + \frac{7}{3p_3} = 2.

Well. The roots turned out to be fairly simple numbers: -3, 1 and 2. That certainly could have been guessed. The method is impressively inefficient in this particular case, forcing us to work with these complex expressions only to get such simple answers eventually. But again: this is foolproof recipe that works for any cubic equation of the form x^3+b x + c = 0.

The General Cubic


So far we dealt with the special case x^3+bx+c=0. In the general case, you start with

ax^3+bx^2+cx+d = 0.

First, divide through by a to get rid of the leading coefficient (we assume that a \neq 0, otherwise it's not a cubic). You now have something like this (renaming the variables to keep things simple):

x^3+bx^2+cx+d = 0.

The coefficient b is minus the sum of the roots. This is just a special case of Vieta's formulas, but if you're not familiar with them you can easily see this by writing

x^3+bx^2+cx+d = (x-x_1)(x-x_2)(x-x_3), expanding and equating coefficients of x^2.

This means that if we shift x by b/3, the sum of the roots of the new equation will be 0. Indeed, let y = x+b/3 or x = y-b/3, substitute in the equation, and observe how x^3 contributes a factor of -by^2 and the bx^2 term contributes by^2 making the quadratic term disappear.

This is much easier to do in specific instances than by following the formulas. If you don't remember what you need to shift the variable by, just write x = y - t, substitute and then find the value of t that makes the square term vanish.

Once you're done solving the formula for y, which is now in the correct form, just remember to subtract b/3 from each solution to get the values of the original x.

That's it!

Originally posted on Quora: https://qr.ae/pFmQmX