Cubic Theory

When programming to find the roots of a cubic, the statements executed will be different depending on the discriminate and the sign of a term. The real and complex components will have to be explicitly evaluated. For $a\bullet {z}^{3}+b\bullet {z}^{2}+c\bullet {z}^{}+d=0$ the discriminate is $D=\frac{4\bullet {m}^{3}}{{n}^{2}}$ , where m = 1/9 - c/3 and n = c/3 - d - 2/27 . The above discriminate is defined so as to be the independent variable for a normalized plot of the real and imaginary components of the roots. The relationship of the roots can be visualized and a starting approximation for obtaining the correct root with Newton's method, can be obtained. Also, the plot could be used as a nomograph for rough answers. The correct log-log plots of subsections of the graph could be referenced also.

The discriminate is defined differently at Weisstein , Wiki and Knaust   They also do not explicitly show the real and imaginary components. They are:

If D<0, then $z={\left(n/2\right)}^{\left(1/3\right)}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}+{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)-\frac{1}{3}$

The real component of the two complex roots is $\mathrm{z2r}=-\frac{{\left(n/2\right)}^{\left(1/3\right)}}{2}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}+{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)-\frac{1}{3}$ The imaginary component of the complex roots is $\mathrm{z2i}=±{\left(n/2\right)}^{\left(1/3\right)}\bullet \frac{\sqrt{3}}{2}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}-{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)$

If 0<D<1, then $z={\left(n/2\right)}^{\left(1/3\right)}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}-{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)-\frac{1}{3}$

The real component of the two complex roots is $\mathrm{z2r}=-\frac{{\left(n/2\right)}^{\left(1/3\right)}}{2}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}-{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)-\frac{1}{3}$ The imaginary component of the complex roots is $\mathrm{z2i}=±{\left(n/2\right)}^{\left(1/3\right)}\bullet \frac{\sqrt{3}}{2}\bullet \left({\left(1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}+{\left(-1±\sqrt{1-\frac{4\bullet {m}^{3}}{{n}^{2}}}\right)}^{\left(1/3\right)}\right)$

If D > 1, Then the three roots are real but all manipulations go through complex phases involving the projections of a vector r having magnitude $r=\sqrt{1+\left(\frac{4\bullet {m}^{3}}{{n}^{2}}-1\right)}$ . The terms and are complex with magnitude r. They can be written in exponential form. and $T=\sqrt{r}\bullet {ℯ}^{\left(\frac{\pi }{3}\bullet i\mp \frac{\mathrm{atan}\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}}{3}\bullet i\right)}$ .   S+T then can be factored? $S+T=\sqrt{r}\bullet {ℯ}^{\frac{\mathrm{atan}\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}\bullet i}{3}}\bullet \left(1+{ℯ}^{\frac{\pi }{3}\bullet i}\right)$ . Now $1+{ℯ}^{\frac{\pi }{3}\bullet i}=1+\frac{1}{2}+\frac{\sqrt{3}}{2}\bullet i=\frac{3}{2}+\frac{\sqrt{3}}{2}\bullet i$ . So, since $x\bullet \mathrm{sin}\left(a+\frac{1}{3}\mathrm{atan}\left(\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}\right)\right)=x\bullet \mathrm{sin}\left(a\right)\bullet \mathrm{sin}\left(\frac{1}{3}\mathrm{atan}\left(\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}\right)\right)+x\bullet \mathrm{cos}\left(a\right)\bullet \mathrm{cos}\left(\frac{1}{3}\mathrm{atan}\left(\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}\right)\right)$ . and using . Thus the first real root is

$z={\left(\frac{n\bullet r}{2}\right)}^{\left(1/3\right)}\sqrt{3}\bullet \mathrm{sin}\left(-\frac{\pi }{6}+\frac{1}{3}\mathrm{atan}\left(\sqrt{\frac{4\bullet {m}^{3}}{{n}^{2}}-1}\right)\right)-\frac{1}{3}$ .

Likewise $S-T=\sqrt{r}\bullet$

where z2 = (z+1/3)/2 -1/3 - zi and z3 = (z+1/3)/2 -1/3 + zi . The curves are plotted on another page. The solutions using Newton's method are shown with circles thus verifying the consistancy of the analytical expressions displayed but not derived here.

For an angle of pi/7 the solution is transcendental but for pi/60 the solution is irrational

$2\bullet \mathrm{cos}\left(2\bullet \pi /7\right)={\left(\frac{7}{\mathrm{27}}\bullet \frac{\sqrt{1+{3}^{3}}}{2}\right)}^{\left(1/3\right)}2\bullet \mathrm{sin}\left(\frac{\pi -\frac{2}{3}\mathrm{atan}\left(\sqrt{\mathrm{27}}\right)}{2}\right)-\frac{1}{3}$

Divide the circle into 120 divisions wthout transendental formulas $\mathrm{16}\bullet \mathrm{sin}\left(\pi /\mathrm{60}\right)=$ $2\bullet \left(1-\sqrt{3}\right)\bullet \sqrt{5+\sqrt{5}}+\sqrt{2}\bullet \left(\sqrt{5}-1\right)\bullet \left(\sqrt{3}+1\right)$

For pi/5 there are details at plato_exp.xml