Difference between revisions of "Cubic formula"

(Cardano's formula)
(Cardano's formula)
(One intermediate revision by the same user not shown)
Line 8: Line 8:
  
 
Now, <math>x=u+v</math>, <math>uv=-\frac{p}{3}</math>, and <math>u^3+v^3=-q</math>. Let's cube p to get <math>u^3v^3=-\frac{p^3}{27}</math> and then write the equation <math>v^3\cdot -q=v^3(v^3+u^3)=v^6+v^3u^3=v^6-\frac{p^3}{27}</math>. This may not sound exciting until our substitution <math>w=v^3</math>. We got rid of <math>u</math> and now we have <math>w^2+\left(q\right)w+\left(-\frac{p^3}{27}\right)</math>
 
Now, <math>x=u+v</math>, <math>uv=-\frac{p}{3}</math>, and <math>u^3+v^3=-q</math>. Let's cube p to get <math>u^3v^3=-\frac{p^3}{27}</math> and then write the equation <math>v^3\cdot -q=v^3(v^3+u^3)=v^6+v^3u^3=v^6-\frac{p^3}{27}</math>. This may not sound exciting until our substitution <math>w=v^3</math>. We got rid of <math>u</math> and now we have <math>w^2+\left(q\right)w+\left(-\frac{p^3}{27}\right)</math>
 +
 +
Using the quadratic formula, <math>w=\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}</math>, so <math>v=\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}</math> and by symmetry, so is <math>u</math>. (If this results in <math>\frac{0}{0}</math>, interpret it as <math>0</math>).
 +
 +
Now, <math>x=\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}+\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}</math> (The two <math>\pm</math>'s need not be the same). As a bonus, if you make the <math>\pm</math>'s <math>+</math> and <math>-</math>, the resulting root is always real.
 +
 +
Substituting back, we get the cubic formula (remember <math>\frac{b}{3a}</math>): <math>x=\sqrt[3]{\frac{\frac{-2b^3-27a^2d+9abc}{27a^3}}{2}\pm\sqrt{\frac{\left(\frac{2b^3+27a^2d-9abc}{27a^3}\right)^2}{4}+\frac{\left(\frac{3ac-b^2}{3a^2}\right)^3}{27}}}+\sqrt[3]{\frac{\frac{-2b^3-27a^2d+9abc}{27a^3}}{2}\pm\sqrt{\frac{\left(\frac{2b^3+27a^2d-9abc}{27a^3}\right)^2}{4}+\frac{\left(\frac{3ac-b^2}{3a^2}\right)^3}{27}}}-\frac{b}{3a}</math>. Simplifying, we get: <math>x=\sqrt[3]{\frac{-2b^3-27a^2d+9abc}{54a^3}\pm\sqrt{\left(\frac{2b^3+27a^2d-9abc}{54a^3}\right)^2+\left(\frac{3ac-b^2}{9a^2}\right)^3}}+\sqrt[3]{\frac{-2b^3-27a^2d+9abc}{54a^3}\pm\sqrt{\left(\frac{2b^3+27a^2d-9abc}{54a^3}\right)^2+\left(\frac{3ac-b^2}{9a^2}\right)^3}}-\frac{b}{3a}</math>.

Revision as of 15:56, 24 June 2024

The cubic formula is a very complicated formula used to solve cubics. It is not used very often, as schools don't teach it and problem writers usually hide a simpler tactic instead.

Cardano's formula

Start with the cubic $ax^3+bx^2+cs+d$. The constant $a$ controls how steep it is. The constant $d$ shifts it up and down. The constant $c$ controls the slope of the middle. And the constant $b$ shifts it left to right. For now, let's just reduce it to $x^3+\frac{b}{a}x^2+\frac{c}{a}x+\frac{d}{a}$, as everyone knows how to do that. Consider the cubic $(x+\frac{b}{3a})^3=x^3+\frac{b}{a}x^2+\frac{b^2}{3a^2}x+\frac{b^3}{27a^3}$. The first two terms match, and if we substitute $x$ with $x-\frac{b}{3a}$, we get rid of that annoying $x^2$ term. We'll just add it back at the end. Making the substitution results in: $\left(x-\frac{b}{3a}\right)^3+\frac{b}{a}\left(x-\frac{b}{3a}\right)^2+\frac{c}{a}\left(x-\frac{b}{3a}\right)+\frac{d}{a}=x^3+\frac{3ac-b^2}{3a^2}x+\frac{2b^3+27a^2d-9abc}{27a^3}$.

By now, let's define $p$ and $q$ as $p=\frac{3ac-b^2}{3a^2}$ and $q=\frac{2b^3+27a^2d-9abc}{27a^3}$. We get the depressed cubic $x^3+px+q=0$ or $x^3=-px-q$. First, let's expand $(u+v)^3=u^3+3u^2v+3uv^2+v^3=3uv(u+v)+(u^3+v^3)$. Now, let $x=u+v$ so $(u+v)^3$ matches up with $x^3$, $3uv(u+v)$ matches up with $-px$, and $(v^3+w^3)$ matches up with $-q$. Things are about to get exciting!

Now, $x=u+v$, $uv=-\frac{p}{3}$, and $u^3+v^3=-q$. Let's cube p to get $u^3v^3=-\frac{p^3}{27}$ and then write the equation $v^3\cdot -q=v^3(v^3+u^3)=v^6+v^3u^3=v^6-\frac{p^3}{27}$. This may not sound exciting until our substitution $w=v^3$. We got rid of $u$ and now we have $w^2+\left(q\right)w+\left(-\frac{p^3}{27}\right)$

Using the quadratic formula, $w=\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}$, so $v=\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}$ and by symmetry, so is $u$. (If this results in $\frac{0}{0}$, interpret it as $0$).

Now, $x=\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}+\sqrt[3]{\frac{-q}{2}+\pm\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}$ (The two $\pm$'s need not be the same). As a bonus, if you make the $\pm$'s $+$ and $-$, the resulting root is always real.

Substituting back, we get the cubic formula (remember $\frac{b}{3a}$): $x=\sqrt[3]{\frac{\frac{-2b^3-27a^2d+9abc}{27a^3}}{2}\pm\sqrt{\frac{\left(\frac{2b^3+27a^2d-9abc}{27a^3}\right)^2}{4}+\frac{\left(\frac{3ac-b^2}{3a^2}\right)^3}{27}}}+\sqrt[3]{\frac{\frac{-2b^3-27a^2d+9abc}{27a^3}}{2}\pm\sqrt{\frac{\left(\frac{2b^3+27a^2d-9abc}{27a^3}\right)^2}{4}+\frac{\left(\frac{3ac-b^2}{3a^2}\right)^3}{27}}}-\frac{b}{3a}$. Simplifying, we get: $x=\sqrt[3]{\frac{-2b^3-27a^2d+9abc}{54a^3}\pm\sqrt{\left(\frac{2b^3+27a^2d-9abc}{54a^3}\right)^2+\left(\frac{3ac-b^2}{9a^2}\right)^3}}+\sqrt[3]{\frac{-2b^3-27a^2d+9abc}{54a^3}\pm\sqrt{\left(\frac{2b^3+27a^2d-9abc}{54a^3}\right)^2+\left(\frac{3ac-b^2}{9a^2}\right)^3}}-\frac{b}{3a}$.