cardano's method - I'm unable to find my mistake

1.5k Views Asked by At

I'm currently trying to calculate zeros of a cubic function using the Cardano formula

I somehow miscalculated really bad and I suspect that I've done a really cheap beginners mistake. I searched but I wasn't able to find my mistake

I only get 2 results with instead of 3 and the values are also off
I know that the cardanian formula isn't very exact especially when you round some values- which I did.

Cardano's method requires the reduced function
(sorry if this i not the correct term but I don't know the correct english name)

I tried to solve this very simple cubic function:
$ 2x^3 + 4x^2 - 2x - 4 $

reduced function:

$ z^3 - pz + q = 0$
$ z^3 - - 2 \frac{1}{3}z + \frac{-20}{27} = 0$

This is cardanos method: \begin{equation*} z=\sqrt[3]{-\frac q 2+\sqrt{(\frac q 2)^2+\frac{p^3}{27}}}+\sqrt[3]{-\frac q 2-\sqrt{(\frac q 2)^2+\frac{p^3}{27}}} \end{equation*}

and I just put my values in and tried calculating it

\begin{equation*}z=\sqrt[3]{-\frac{\frac{-20}{27}} 2+\sqrt{\left(\frac{\frac{-20}{27}} 2\right)^2+\frac{\left(-2\frac 1 3\right)^3}{27}}}+\sqrt[3]{-\frac{\frac{-20}{27}} 2-\sqrt{\left(\frac{\frac{-20}{27}} 2\right)^2+\frac{\left(-2\frac 1 3\right)^3}{27}}}\end{equation*}\begin{equation*}z=\sqrt[3]{\frac{10}{27}+\sqrt{\left(\frac{-10}{27}\right)^2+\frac{-343}{729}}}+\sqrt[3]{\frac{10}{27}-\sqrt{\left(\frac{-10}{27}\right)^2+\frac{-343}{729}}}\end{equation*}\begin{equation*}z=\sqrt[3]{\frac{10}{27}+\sqrt{\frac{-1} 3}}+\sqrt[3]{\frac{10}{27}-\sqrt{\frac{-1} 3}}\end{equation*}\begin{equation*}z=\sqrt[3]{\frac{10}{27}+(\pm 0,5774)}+\sqrt[3]{\frac{10}{27}-(\pm 0,5774)}\end{equation*}


These are the two possible solutions:

\begin{equation*}z_1=\sqrt[3]{\frac{10}{27}+0,5774}+\sqrt[3]{\frac{10}{27}-0,5774}\end{equation*}\begin{equation*}z_1=\sqrt[3]{0,98226}+\sqrt[3]{-0,59152}\end{equation*}\begin{equation*}z_1=0,99405-0,83944\end{equation*}\begin{equation*}z_1=1,8335\end{equation*}

\begin{equation*}z_2=\sqrt[3]{\frac{10}{27}-0,5774}+\sqrt[3]{\frac{10}{27}+0,5774}\end{equation*}\begin{equation*}z_2=\sqrt[3]{-0,59152}+\sqrt[3]{0,98226}\end{equation*}\begin{equation*}z_2=0,83944-0,99405\end{equation*}\begin{equation*}z_2=-0.15461\end{equation*}

I used this online calculator to calculate the zeros but got a totally diffrent valus that my cardanos method results. The calculator says that the graph has 3 zero points at $-2$,$-1$ and $1$.
I think I've made a very embarrassing mistake somewhere.

I know that cardanos method isn't very useful from todays perspective but I need to turn in an work on thus very soon and I'm pretty much done except with these example calculations.

I hope you guys are able to help me :)

Thanks for reading. Have a nice day

3

There are 3 best solutions below

4
On BEST ANSWER

Cardano's formula won't work here, as this equation has $3$ real roots. If you examine the way this formula is obtained, you'll see it comes down to finding two numbers when their product and sum are given. This is a typical problem of quadratic equations, and it has solutions if the discriminant of the quadratic equation is non-negative.

Now it happens that, when the cubic equation has $3$ real roots, this discriminant is negative,. The formula remains true, but you have to consider a real number has $3$ complex cubic roots, of which one is real. Actually this case was the reason for introducing complex numbers at the time.

In such a case, a trigonometric resolution is much more efficient. For your equation this isn't even necessary, as it is enough to do partial factorisations to find the roots: $$2x^3+4x^2-2x-4=2x(x^2-1)+4(x^2-1)=2(x-1)(x+1)(x+2).$$

0
On

Your mistake is when taking the square root of $-1/3$. This yields complex numbers, of which you need to take the cubic root.

For this particular equation, it is much easier to observe that $x=1$ is a root. Then by polynomial division,

$$2x^3+4x-2x-4=2(x-1)(x^2+3x+2).$$

The rest is elementary.

0
On

Let $f(x) = x^3 + 2x^2 - x - 2$

Let $k = -2/3$

$$f(x) = f(y+k) = y^3 + f'(k)\;y + f(k) = y^3-{7\over3}y - {20\over27}$$

Make the polynomial fit form: $y^3+3py+2q$

$$(p,q) =\left({-7\over9}, {-10\over27} \right)\quad → D = p^3+ q^2 = {-1\over3}$$

We only calculate 1 term, the other to be derived.

$\alpha = \sqrt[3]{-q - \sqrt{D}}=\large \sqrt[3]{{10\over27}-\sqrt{{-1\over3}}} = -{2\over3}-{1 \over \sqrt3}i$
$\beta=\large{-p\over \alpha} = -{2\over3}+{1 \over \sqrt3}$
$\omega = \large e^{2\pi i \over 3} = -{1\over2}+{\sqrt3 \over 2}$

All $y$ roots must maintain the relation: $\;\alpha \beta = -p$

$$y\;roots = (\;\alpha + \beta,\; \alpha\,\omega + \beta/\omega,\; \alpha/\omega + \beta\,\omega\;)$$

$$x\;roots = \left({-4\over3}, {5\over3}, {-1\over3}\right) + k = (-2,1,-1)$$