Cubic Formula Derivation Check and Questions

208 Views Asked by At

Here is the general cubic, with the $x^3$ coefficient already divided into the other coefficients, right hand side already set to zero because we are finding roots: $x^3+ax^2+bx+c=0$.

We substitute in $x=y-\frac{a}{3}$ to get $$\begin{aligned} \left(y^3 - \frac{2a}{3}y^2 + \frac{a^2}{9}y - \frac{a}{3}y^2 + \frac{2a^2}{9}y - \frac{a^3}{27}\right)& \\ + a\left(y^2 - \frac{2a}{3}y + \frac{a^2}{9}\right)& \\ + b\left(y - \frac{a}{3}\right)& \\ + c = 0 \end{aligned}$$ Simplifying to give $$\begin{aligned} y^3 \color{blue}{- ay^2} \color{bluegreenish}{+ \frac{a^2}{3}y} \color{green}{- \frac{a^3}{27}}& \\ \color{blue}{+ ay^2} \color{bluegreenish}{- \frac{2a^2}{3}y} \color{green}{+ \frac{a^3}{9}}& \\ \color{bluegreenish}{+ by} \color{green}{- \frac{ab}{3}}& \\ \color{green}{+c} &= 0 \end{aligned}$$ Simplifying more to give $$y^3 - \frac{a^2}{3}y + by - \frac{a^3}{27} + \frac{a^3}{9} - \frac{ab}{3} + c = 0$$

This is of the form $y^3+dy+e=0$ where $$d=b-\frac{a^2}{3} \text{ and } e= - \frac{a^3}{27} + \frac{a^3}{9} - \frac{ab}{3} + c$$

We substitute $y=\sqrt[3]{u}-\sqrt[3]{v}$ to get $$\sqrt[3]{u}^3 - 3 \sqrt[3]{u}^2 \sqrt[3]{v} + 3 \sqrt[3]{u} \sqrt[3]{v}^2 - \sqrt[3]{v}^3 + d\sqrt[3]{u} - d\sqrt[3]{v} + e = 0$$

Simplifying to get $$(u - v) - d\sqrt[3]{v} - 3 \sqrt[3]{u}^2 \sqrt[3]{v} + d\sqrt[3]{u} + 3 \sqrt[3]{u} \sqrt[3]{v}^2 + e = 0$$

Anti-distributing to get $$(u - v) - \sqrt[3]{v}(d - 3 \sqrt[3]{u}^2) + \sqrt[3]{u}(d + 3 \sqrt[3]{v}^2) + e = 0$$

Let's define $\color{purple}{v-u=e}$ ('cause we can), causing $- \sqrt[3]{v}(d - 3 \sqrt[3]{u}^2) + \sqrt[3]{u}(d + 3 \sqrt[3]{v}^2) = 0$, which can be simplified to

$$\begin{aligned} \sqrt[3]{u}(d + 3 \sqrt[3]{v}^2) &= \sqrt[3]{v}(d + 3 \sqrt[3]{u}^2) \\ d\sqrt[3]{u} + 3\sqrt[3]{u}\sqrt[3]{v}^2 &= d\sqrt[3]{v} + 3\sqrt[3]{v}\sqrt[3]{u}^2 \\ d\sqrt[3]{u}-d\sqrt[3]{v} &= 3 \sqrt[3]{v} \sqrt[3]{u}^2 - 3 \sqrt[3]{u} \sqrt[3]{v}^2 \\ d(\sqrt[3]{u}-\sqrt[3]{v}) &= 3 \sqrt[3]{v}\sqrt[3]{u}(\sqrt[3]{u} - \sqrt[3]{v}) \\ d &= 3 \sqrt[3]{v}\sqrt[3]{u} \\ \frac{d}{3} &= \sqrt[3]{uv} \\ \color{purple}{\frac{d^3}{27}} &\color{purple}{= uv} \end{aligned}$$

From the first purple equation, we have $v=e+u$, which we can put into the second to get $$u(e+u)=\frac{d^3}{27} \to u^2 + eu - \frac{d^3}{27}=0$$ Where we can solve for $u$ with the quadratic formula. $$u=\frac{-e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}$$

We can also get equations for $v$; the first equation gives $u=v-e$, which we stuff into the second equation to get $$v(v-e)=\frac{d^3}{27} \to v^2 - ev - \frac{d^3}{27}$$ Quadratic formula yielding $$v=\frac{e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}$$

Via our definition above $(y=\sqrt[3]{u}-\sqrt[3]{v})$, we get $$y=\sqrt[3]{\frac{-e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}}-\sqrt[3]{\frac{e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}}$$ And from the definition above that $(x=y-\frac{a}{3})$, we have $$x=\sqrt[3]{\frac{-e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}}-\sqrt[3]{\frac{e\pm\sqrt{e^2+4\frac{d^3}{27}}}{2}}-\frac{a}{3}$$

Okay, now that I had that, I went to Desmos and graphed a general cubic with points at the roots of the cubic as calculated from this formula, here, where I replaced the variable e from above with f: https://www.desmos.com/calculator/fqnobwyfmp.

Here is the Wolfram Mathematica code:

"Coefficients"
a=3
b=-1
c= 0

"Variables"
d=ToExpression["b-\\frac{a^2}{3}",TeXForm]
f=ToExpression["-\\frac{a^3}{27}+\\frac{a^3}{9}-\\frac{a*b}{3}+c", TeXForm]
g=ToExpression["f^2+\\frac{4*d^3}{27}", TeXForm]

"u"
u=ToExpression["\\frac{-f+\\sqrt{g}}{2}", TeXForm]
m1=Re[u]
n1=Im[u]
r1=Sqrt[m1^2+n1^2]
t1=Limit[ArcTan[n1/k],k->m1]
w=CubeRoot[r1]*(Cos[t1/3]+I*Sin[t1/3])

"v"
v=ToExpression["\\frac{f+\\sqrt{g}}{2}", TeXForm]
m=Re[v]
n=Im[v]
r=Sqrt[m^2+n^2]
t=Limit[ArcTan[n/l],l->m]
z=CubeRoot[r]*(Cos[t/3]+I*Sin[t/3])

"Roots of unity"
p=-1/2 + I*Sqrt[3]/2
q=-1/2 - I*Sqrt[3]/2

"y"
If[w==0,y1=w-z, y1=w-d/(3*w)]
If[w==0,y2=p*w-q*z, y2=p*w-q*d/(3*w)]
If[w==0,y3=q*w-p*z,y3=q*w-p*d/(3*w)]

"x"
x1=y1-a/3
Style[Simplify[%],FontSize->30]
x2=y2-a/3
Style[Simplify[%],FontSize->30]
x3=y3-a/3
Style[Simplify[%],FontSize->30]

Data={{Re[x1],0},{Re[x2],0},{Re[x3],0}}
Show[Plot[{x^3+a*x^2+b*x+c},{x,-5,5},PlotRange->15], Graphics[{PointSize[Medium], Red, Point[Data]}]]

Here are my questions:

  1. When I have one root, Roots 1 and 4 are on the right point, but Root 2 and Root 3 are somewhere unrelated. Where do the values of Roots 2 and 3 come from?

  2. When I have more than one root, the quadratic formulas yield imaginary numbers, when clearly there are real roots. Why? Did I do something wrong in my derivation?

  3. Clearly my cubic formula completely failed. What happened? How do I know which of the 4 possible roots are actually roots?

Thanks for any help! I know it was a lot to read.

1

There are 1 best solutions below

0
On BEST ANSWER

You look for solutions parameterised by $y=\sqrt[3]{u} - \sqrt[3]{v}$ for some $u$ and $v$ and assume in addition $e=v-u$. That is of course fine, but $u$ and $v$ do not necessarily have to be real numbers. For instance take two real valued constants $a$ and $b$ and set $u=(-a+b \imath)^3$ and $v=(a+b \imath)^3$ to be complex numbers, than $$ v - u = (a+b \imath)^3 - (-a+b \imath)^3 = 2 a^3 - 6 a b^2 $$ which is real and $$ \sqrt[3]{u} - \sqrt[3]{v} = (-a+b\imath) - (a+b \imath)^3 = -2 a $$ there is a catch, just like the square root of a positive number has a two solutions, $\sqrt{4} = \pm 2$ also the third root has multiple solutions. In fact there are always three because $$ 1 = \left(-\frac{1}{2} + \frac{\imath}{2} \sqrt{3}\right)^3 = \left(-\frac{1}{2} - \frac{\imath}{2} \sqrt{3}\right)^3 $$ Hence if you know the third root of some number by multiplying the number with either complex factor give you another different answer.

Now back to the problem at hand. Up to the point that you found the two solutions $u_\pm$ it is fine. But since you explicitly assumed $e=u-v$ there is a unique answer for $v$ so only one of the two options $v_\pm$ is correct. Hence you get the combination $(u_+,v_+)$ or $(u_-,v_-)$. Since it is easy to see that $u_+=-v_-$ and $v_+=-u_-$ you get for the solution of $y$ that: $$ y = \sqrt[3]{u_+} - \sqrt[3]{v_+} = \sqrt[3]{-v_-} - \sqrt[3]{-u_-} = -\sqrt[3]{v_-} + \sqrt[3]{u_-} = \sqrt[3]{u_-} - \sqrt[3]{v_-} $$ and find that they result in the same solution. This is why you get two correct (but identical) solutions and the two other combinations don't satisfy $e=v-u$ and are therefore wrong.

So what happened to the fact that there are supposed to be three solutions for a cubic equation? This is where the different third roots come into the picture, because there are three ways to take either of the cube roots $\sqrt[3]{u_+}$ and $\sqrt[3]{v_+}$, and suitable combinations give the other two solutions.

To make things worse, the argument $e^2+ \frac{4 d^3}{27}$ in the square root can be negative and one has to be carful in selecting the correct roots and third roots in these expressions.

For that reason one would write the solution of $y$ in a slightly different form: $$ y = \sqrt{u_+} - \frac{d}{3} \frac{1}{\sqrt[3]{u_+}} $$ where I used $u_+ v_+ = \frac{d^3}{27}$ which is a real number and has always $\frac{d}{3}$ as a real third root. The other solutions for $y$ than follow by using the alternative solutions for the third root: $$ y = \left(-\frac{1}{2} + \frac{\imath}{2} \sqrt{3}\right)\sqrt[3]{u_+} - \left(-\frac{1}{2} - \frac{\imath}{2} \sqrt{3}\right) \frac{d}{3} \frac{1}{\sqrt[3]{u_+}} $$ $$ y = \left(-\frac{1}{2} - \frac{\imath}{2} \sqrt{3}\right)\sqrt[3]{u_+} - \left(-\frac{1}{2} + \frac{\imath}{2} \sqrt{3}\right) \frac{d}{3} \frac{1}{\sqrt[3]{u_+}} $$