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 z 3 + b z 2 + c z + d = 0 the discriminate is D = 4 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 = n / 2 1 / 3 1 ± 1 - 4 m 3 n 2 1 / 3 + - 1 ± 1 - 4 m 3 n 2 1 / 3 - 1 3

The real component of the two complex roots is z2r = - n / 2 1 / 3 2 1 ± 1 - 4 m 3 n 2 1 / 3 + - 1 ± 1 - 4 m 3 n 2 1 / 3 - 1 3 The imaginary component of the complex roots is z2i = ± n / 2 1 / 3 3 2 1 ± 1 - 4 m 3 n 2 1 / 3 - - 1 ± 1 - 4 m 3 n 2 1 / 3

If 0<D<1, then z = n / 2 1 / 3 1 ± 1 - 4 m 3 n 2 1 / 3 - - 1 ± 1 - 4 m 3 n 2 1 / 3 - 1 3

The real component of the two complex roots is z2r = - n / 2 1 / 3 2 1 ± 1 - 4 m 3 n 2 1 / 3 - - 1 ± 1 - 4 m 3 n 2 1 / 3 - 1 3 The imaginary component of the complex roots is z2i = ± n / 2 1 / 3 3 2 1 ± 1 - 4 m 3 n 2 1 / 3 + - 1 ± 1 - 4 m 3 n 2 1 / 3

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 = 1 + 4 m 3 n 2 - 1 . The terms S = 1 ±   1 - 4 m 3 n 2 3 and T = - 1 ±   1 - 4 m 3 n 2 3 are complex with magnitude r. They can be written in exponential form. S = r 3 ±   atan 4 m 3 n 2 - 1 i 3 and T = r 3 π 3 i atan 4 m 3 n 2 - 1 3 i .   S+T then can be factored? S + T = r 3 atan 4 m 3 n 2 - 1 i 3 1 + π 3 i . Now 1 + π 3 i = 1 + 1 2 + 3 2 i = 3 2 + 3 2 i . So, since x sin a + 1 3 atan 4 m 3 n 2 - 1 = x sin a sin 1 3 atan 4 m 3 n 2 - 1 + x cos a cos 1 3 atan 4 m 3 n 2 - 1 . and using x sin a = 3 2   and   x cos a = - 3 2 . Thus the first real root is

z = n r 2 1 / 3 3 sin - π 6 + 1 3 atan 4 m 3 n 2 - 1 - 1 3 .

Likewise S - T = r 3

zi ?= ±   n r 2 3 1 3 cos π 2 - 1 3 atan 4 m 3 n 2 - 1

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 cos 2 π / 7 = 7 27 1 + 3 3 2 1 / 3 2 sin π - 2 3 atan 27 2 - 1 3

Divide the circle into 120 divisions wthout transendental formulas 16 sin π /60 = 2 1 - 3 5 + 5 + 2 5 - 1 3 + 1

For pi/5 there are details at plato_exp.xml