The classic technique to solve a cubic equation x3+ax2+bx+c=0
is called Cardano’s formula, which reduces the original equation to the more simple form. t3+pt+q=0
Once the solution t is found, x can be naturally obtained from x=t−a/3. So, replacing x by t−a/3 in the original equation to find p and q, ==⟹(t−3a)3+a(t−3a)2+b(t−3a)+c(t3−3t23a+3t9a2−27a3)+a(t2−2t3a+9a2)+b(t−3a)+ct3+(b−3a2)t+272a3−3ab+c=0p=b−3a2q=272a3−3ab+c
Note that this note is only interested in finding real roots.
Case 1. p=0 or q=0
If p=q=0, the reduced form becomes t3=0, which produces x=−a/3.
If p=0 and q=0, the reduced form becomes t3+q=0, which produces x=3−q−a/3.
If q=0 and p=0, the reduced form becomes t3+pt=t(t2+p)=0, which produces x=−a/3, or x=±−p−a/3 if only p<0.
In the case of p=0 and q=0, the following identity can be considered. (u−v)3+3uv(u−v)=u3−v3
This identity can be reformed to t3+pt+q=0 form by setting t=u−v, p=3uv, and q=v3−u3. Since p=0 and q=0, v=3up⟹q=v3−u3=(3up)3−u3⟹u3+q−(3up)3=0⟹u6+qu3−(3p)3=0⟹u3=2−q±q2+4(3p)3=−2q±(2q)2+(3p)3
In a similar manner, u=3vp⟹q=v3−u3=v3−(3vp)3⟹v3−q−(3vp)3=0⟹v6−qv3−(3p)3=0⟹v3=2q±q2+4(3p)3=2q±(2q)2+(3p)3
From now on, let Δ=(q/2)2+(p/3)3. u3=−2q±Δ,v3=2q±Δ
Case 2. Δ=0 (All roots are real and two equal)
This case makes u3=−q/2 and v3=q/2. Recall that the solutions of y3−1=0 are y=1,e2πi/3,e4πi/3 according to the root of unity. Keeping in mind p=3uv is constant which means that uv must be constant, it indicates that u and v are rotated in the opposite direction of each other in the complex plane. uv=3−2q,3−2qe−2πi/3,3−2qe−4πi/3=32q,32qe2πi/3,32qe4πi/3
If u=3−q/2 and v=3q/2, the solution of the reduced form is t=u−v=23−q/2, which produces x=23−q/2−a/3.
Note that ± is eventually disappeared. So, x=3−q/2+Δ+3−q/2−Δ−a/3.
Case 4. Δ<0 (All roots are real and different)
In this case, u and v are complex numbers. u3=−2q±i−Δ,v3=2q±i−Δ
Recall that a complex number m+ni can be represented as r(cosϕ+isinϕ) where r=m2+n2, cosϕ=m/r, and sinϕ=n/r. With this, u3 can be rewritten as r(cosϕ+isinϕ) where r=(2q)2−Δ,cosϕ=−2rq,sinϕ=r±−Δ
Then, v3 can be also rewritten, noting that it has the same r of u. rv=(2−q)2−Δ=r,cosϕv=2rq=−cosϕ,sinϕv=r±−Δ=sinϕ
which means that v3=r(−cosϕ+isinϕ)=−r(cosϕ−isinϕ)=−r(cos(−ϕ)+isin(−ϕ)). More simply, u3=reiϕ and v3=−re−iϕ. Again, keeping in mind uv is constant, rotate each u and v in the opposite direction in the complex plane. uv=3reϕi/3,3re(ϕ+2π)i/3,3re(ϕ+4π)i/3=3−re−ϕi/3,3−re−(ϕ+2π)i/3,3−re−(ϕ+4π)i/3
Besides all cos forms as above, the alternative form can be derived with sin and a quadratic equation. First, let the last root above be α. From cos(π/2+θ)=−sinθ and sinθ=sin(π−θ), α=23rcos(3ϕ+4π)=−23rsin(3ϕ+65π)=−23rsin(π−(3ϕ+65π))=−23rsin(6π−3ϕ)=−23rsin(31(2π−ϕ))
Since cosϕ=−2rq=sin(2π−ϕ)
α can be rewritten only using sin and sin−1 forms. α=−23rsin(31(2π−ϕ))=−23rsin(31sin−1(−2rq))
Once α is obtained, the reduced cubic equation can be factorized. t3+pt+q=(t−α)(t2+αt+α2+p)=0
This implies that the other roots come from the quadratic equation t2+αt+α2+p which is relatively easy work. t=2−α±α2−4(α2+p)=2−α±−3α2−4p
To sum up, all solultions are xxx=−23rsin(31sin−1(−2rq))−3a=α−3a=2−α+−3α2−4p−3a=2−α−−3α2−4p−3a
Keep going!Keep going ×2!Give me more!Thank you, thank youFar too kind!Never gonna give me up?Never gonna let me down?Turn around and desert me!You're an addict!Son of a clapper!No wayGo back to work!This is getting out of handUnbelievablePREPOSTEROUSI N S A N I T YFEED ME A STRAY CAT