I’ve Hit a Major Snag While Writing a Paper on Deriving the Cubic Formula!

algebra-precalculuscubics

So I've writing a paper for school on deriving the cubic formula. As of now I have written the cubic formula as a system of two equations in terms of original coefficients $a$, $b$, $c$, and $d$. The system is below:

$$z=\sqrt[3]{\frac{9abc-2b^3-27a^2d}{54a^3}\pm\sqrt{\frac{4ac^3+27a^2d^2-18abcd-b^2c^2+b^3d}{108a^4}}}$$

$$x=z-\frac{\left(\frac{-b^2}{3a^2}+\frac{c}{a}\right)}{3z}-\frac{b}{3a}$$

This system is almost entirely based off the work shown in this article (http://math.sfsu.edu/smith/Documents/Cubic&Quartic.pdf). The article says that "Actually, the equation for $z$ gives three complex cube roots for each of the $+$ and $–$ signs, hence six different formulas for $z$. But when you substitute these in the equation for $y$, at most three different $y$ values will result, and the last equation will thus give at most three distince [sic] roots $x$." The mention of a $y$-value can safely be equated to my $x$-value since I combined the original article's two equations ($y=z-\frac{p}{3z}$ and $x=y-\frac{b}{3a}$ into a single equation). Thus, according to the very article that this equation was formulated from, when using the formula I should get 6 $z$-values, but upon plugging these into my second equation to solve for $x$, I should see only 3 distinct $x$-values.

When I test this, however, with the cubic $-2x^3+3x^2-x+5=0$, which has solutions 1.92, -0.21-1.12$i$, and -0.21+1.12$i$, I get the following:

$$z_1=1.399 \therefore x_1=1.901$$
$$z_2=-0.67+1.16i \therefore x_2=-0.2+1.11i$$
$$z_3=-0.67-1.16i \therefore x_3=-0.2-1.11i$$
$$z_4=0.461 \therefore x_4=1.142$$
$$z_5=-0.23+0.4i \therefore x_5=0.18+0.24i$$
$$z_6=-0.23-0.4i \therefore x_6=0.18-0.24i$$

Note that $z_1$, $z_2$, and $z_3$ all came from using a $+$ sign for the $\pm$ input in the equation for $z$ (the complex solutions came from multiplying the real solution by $e^\frac{2i\pi}{3}$ and $e^\frac{4i\pi}{3}$). Coincidentally (or not) only these 3 $z$-values gave correct (though somewhat off due to lazy rounding) $x$-values. The $z$-values derived by using a $-$ sign for the $\pm$ input ($z_4$, $z_5$, and $z_6$), however, did not yield correct $x$-values. More crucially, the prediction the article made that the 6 $z$-values would collapse into only 3 $x$-values when plugged into the second equation did not come true.

This has left me with really nowhere to go. I cannot possibly justify my paper by simply stating that "you have to only use the $+$ side of the $\pm$ sign when solving for $z$ because it just works that way." I need some justification for this decision. Or possibly I have made some mistakes in my calculations and the article's assertion was, indeed, correct. That's what I'm hoping to learn from you guys! If you have any insight into this problem, any questions for me, or any advice, please reach out!

Best Answer

The formula for $x$ and $z$ in the link is

$$ x = z - \frac{p}{3z} - \frac{b}{3a} \qquad \text{and}\qquad z = \sqrt[3]{-\frac{q}{2} \pm \sqrt{D}}, $$

where $p$, $q$, and $D$ are defined by

$$ p = -\frac{b^2}{3a^2} + \frac{c}{a}, \qquad q = \frac{2b^3}{27a^3} - \frac{bc}{3a^2} + \frac{d}{a}, \qquad\text{and}\qquad D = \frac{q^2}{4} + \frac{p^3}{27}. $$

Applying this to $-2x^3+3x^2-x+5=0$, we obtain

$$ p = -0.25, \qquad q = -2.5, \qquad D \approx 1.56192. $$

Then the six possible values of $z$, denoted by

$$ z_{k,\pm} = e^{2k\pi i/3} \sqrt[3]{-\frac{q}{2} \pm \sqrt{D}}, $$

are given by

\begin{align*} z_{0,+} &\approx 1.35717 & \Rightarrow \quad x &\approx 1.91857, \\ z_{1,+} &\approx -0.678583 + 1.17534 i & \Rightarrow \quad x &\approx -0.209285 + 1.12216 i, \\ z_{2,+} &\approx -0.678583 - 1.17534 i & \Rightarrow \quad x &\approx -0.209285 - 1.12216 i, \\ z_{0,-} &\approx 0.0614024 & \Rightarrow \quad x &\approx 1.91857, \\ z_{1,-} &\approx -0.0307012 + 0.0531761 i & \Rightarrow \quad x &\approx -0.209285 - 1.12216 i, \\ z_{2,-} &\approx -0.0307012 - 0.0531761 i & \Rightarrow \quad x &\approx -0.209285 + 1.12216 i. \\ \end{align*}

So I suspect that you made some mistakes. Note that, when computing $z_{k,-}$'s, you have to work with the expression

$$ -\frac{q}{2} - \sqrt{D} $$

where

$$-\frac{q}{2} = 1.25 \qquad\text{and}\qquad \sqrt{D} \approx 1.2497684970810779307.$$

Since these values are very close, their difference leads to the loss of several significant digits. For instance, if we use six digits, then

$$ -\frac{q}{2} - \sqrt{D} \approx (1.25) - (1.24977) = 0.00023, $$

losing four digits in the process! Now, given that you are working under only three significant digits, you will almost certainly lose all the significant digits in this process, ending up with quantities dominated by rounding errors. I strongly suspect that this is the source of your incorrect answer.

Related Question