Description: An example of how to find a root of a cubic polynomial.
Compute Environment: Ubuntu 18.04 (Deprecated)
Solving a Cubic - by hand
Solving a cubic polynomial equation can be done by hand. But the computations are a bit tedious. The process is long enough that it is common to have an error of simple arithmetic pop up. Since a computer is good at avoiding those, let's use this worksheet to make the process cleaner.
We wish to find the roots of the cubic polynomial
that is, we want to find the solutions of the equation
x^3 + 5*x^2 - 14*x + 26
Step One: get into the reduced form x3+px+q=0
Our polynomial is already has a leading coefficient of 1, so we are left to find a substitution that removes the quadratic term. This should work:
1/27*(3*z - 5)^3 + 5/9*(3*z - 5)^2 - 14*z + 148/3
z^3 - 67/3*z + 1582/27
We see that p=−67/3 and q=1582/27
Step Two: Compare with the "ideal form"
If we were lucky, we could compare our polynomial with the cube-of-a-sum polynomial and see the answer magically. Let's get our comparison object down, at least. Of course, it requires the insight to use this clever rearrangment:
If we move stuff around, we want to compare
Let's guess that z=u+v, and so, by pattern matching, we want
So we deduce that u and v should satisfy these equations:
Step Three: Solve for u3 and v3
It is a challenge to solve for u and v directly. Instead, let us try to solve for s=u3 and t=v3. Note that we know
s+t and s⋅t. This means we can rely on our knowlege of quadratic equations! As a refresher:
s*t - s*x - t*x + x^2
so we can recover s and t from their sum and product by using the quadratic formula. That is niiiiiiiice.
I'm gonna use a little wizardry to get things arranged but keep from retyping numbers. We want to find the roots of
so, we set up as follows:
Finally, we can use the quadratic equation.
u3=(-b+(b^2-4*c).sqrt())/2# note that a = 1v3=(-b-(b^2-4*c).sqrt())/2
Here is the big reveal, what do we find for u3 and v3?
Alright! those are at least numbers. So far, so good. Let's ask for approximations of those numbers to get a sense of what we have.
Now we just need to find the cube roots of these to get u and v
Find u and v by extracting cube roots
This is a little tricky sometimes. Here SageMath will introduce complex numbers if I do 3−something, so we do a little hack to keep it happy.
Okay. That is my best guess at an answer. This number soln is a root of our cubic in z. We'll have to adjust to get x=z−5/3.
We can check the quality of our answer in two ways
we can evaluate our polynomial at this value final and see if we get zero, or
We can graph the original cubic between x=−8 and x=−7 and look for a root.