Difference between revisions of "Cubic Equation"

m (Added a category)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A cubic equation is an equation of the form:
+
A '''cubic equation''' is an equation of the form:
  
 
<math>ax^3 + bx^2 + cx + d = 0</math>.
 
<math>ax^3 + bx^2 + cx + d = 0</math>.
  
A cubic equation has 3 roots, either all real OR one real, two complex.
+
A cubic equation has 3 [[roots]], either all [[real number|real]] OR one real, two [[complex number|complex]].
  
 
==Solving Cubic Equations==
 
==Solving Cubic Equations==
  
You start with the equation <math>ax^3 + bx^2 + cx + d = 0</math>.
+
If you're too lazy to follow, look at subsection "TLDR" for each section.
 +
===Converting to a Depressed Equation===
 +
You start with the [[equation]] <math>ax^3 + bx^2 + cx + d = 0</math>.
  
 
Divide both sides by a: <math>x^3 + \frac{b}{a}x^2 + \frac{c}{a}x + \frac{d}{a}</math>.
 
Divide both sides by a: <math>x^3 + \frac{b}{a}x^2 + \frac{c}{a}x + \frac{d}{a}</math>.
  
Now we change the coefficient of <math>x^2</math> to <math>0</math> (e.g. change it to a depressed cubic). We do this by substituting <math>y = x + \frac{b}{3a}</math> or <math>y - \frac{b}{3a} = x</math>, giving:
+
Now we change the [[coefficient]] of <math>x^2</math> to <math>0</math> (e.g. change it to a depressed cubic). We do this by [[substitution|substituting]] <math>x = y - \frac{b}{3a}</math>, giving:
  
 
<math>\left(y - \frac{b}{3a}\right)^3 + \frac{b}{a}\left(y - \frac{b}{3a}\right)^2 + \frac{c}{a}\left(y - \frac{b}{3a}\right) + \frac{d}{a} = 0</math>
 
<math>\left(y - \frac{b}{3a}\right)^3 + \frac{b}{a}\left(y - \frac{b}{3a}\right)^2 + \frac{c}{a}\left(y - \frac{b}{3a}\right) + \frac{d}{a} = 0</math>
Line 20: Line 22:
  
 
<math>\left(\frac{3ac - b^2}{3a^2}\right)</math> is <math>p</math> and <math>\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)</math> is <math>q</math>, so now we have <math>y^3 + py + q = 0</math>.
 
<math>\left(\frac{3ac - b^2}{3a^2}\right)</math> is <math>p</math> and <math>\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)</math> is <math>q</math>, so now we have <math>y^3 + py + q = 0</math>.
 +
 +
====TLDR?====
 +
 +
The equation is <math>y^3 + py + q = 0</math> where <math>p = \left(\frac{3ac - b^2}{3a^2}\right)</math> and <math>q = \left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)</math>.
 +
 +
===Solving the Depressed Equation===
  
 
Now here comes the smart part. Substitute <math>y = \sqrt[3]{u} - \sqrt[3]{v}</math>.
 
Now here comes the smart part. Substitute <math>y = \sqrt[3]{u} - \sqrt[3]{v}</math>.
Line 29: Line 37:
 
<math>u - v - (3\sqrt[3]{uv} - p)(\sqrt[3]{u} - \sqrt[3]{v}) = -q</math>
 
<math>u - v - (3\sqrt[3]{uv} - p)(\sqrt[3]{u} - \sqrt[3]{v}) = -q</math>
  
We want that last term to equal <math>0</math>, so we can set <math>3\sqrt[3]{uv} - p = 0</math>. (We can't use <math>\sqrt[3]{u} - \sqrt[3]{v} = 0</math>, because then <math>y = 0</math>, which is not necessarily true.) Solving this equation gives us <math>uv = \frac{p^3}{27}</math>. If <math>uv = \frac{p^3}{27}</math>, then <math>v - u = q</math>. We now have a system of equations:
+
We want that last term to equal <math>0</math>, so we can set <math>3\sqrt[3]{uv} - p = 0</math>. (We can't use <math>\sqrt[3]{u} - \sqrt[3]{v} = 0</math>, because then <math>y = 0</math>, which is not necessarily true.) Solving this equation gives us <math>uv = \frac{p^3}{27}</math>. If <math>uv = \frac{p^3}{27}</math>, then <math>v - u = q</math>. We now have a [[system of equations]]:
  
 
<math>\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}</math>.
 
<math>\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}</math>.
  
We can solve this via the [[quadratic formula]]. After <math>u</math> and <math>v</math> are obtained, we have <math>y = \sqrt[3]{u} - \sqrt[3]{v}</math> and <math>x = \sqrt[3]{u} - \sqrt[3]{v} - \frac{b}{3a}</math>. (Note: "<math>\sqrt[3]{ }</math>" means any cube root.
+
We can solve this via the [[quadratic formula]]. After <math>u</math> and <math>v</math> are obtained, we have <math>y = \sqrt[3]{u} - \sqrt[3]{v}</math> and <math>x = \sqrt[3]{u} - \sqrt[3]{v} - \frac{b}{3a}</math>.
  
==The Cubic Formula==
+
====TLDR?====
 +
<math>x = \sqrt[3]{u} - \sqrt[3]{v} - \frac{b}{3a}</math> where u and v are roots of the system <math>\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}</math>.
 +
 
 +
==The [[Cubic formula]]==
 
The cubic formula can be obtained by using the above method. These are the steps:
 
The cubic formula can be obtained by using the above method. These are the steps:
  
Line 60: Line 71:
 
<math>- \sqrt[3]{\frac{\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) \pm \sqrt{\frac{3\left(\frac{2b^3 - 9abc + 27a^2d}{9a^3}\right)^2 - 4\left(\frac{3ac - b^2}{3a^2}\right)^3\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)}{27}}}{2}} - \frac{b}{3a}</math>
 
<math>- \sqrt[3]{\frac{\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) \pm \sqrt{\frac{3\left(\frac{2b^3 - 9abc + 27a^2d}{9a^3}\right)^2 - 4\left(\frac{3ac - b^2}{3a^2}\right)^3\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)}{27}}}{2}} - \frac{b}{3a}</math>
  
(See? I told you it would be messy.)
+
(See? I told you it would be messy.) I'm not going to simplify all that squaring and cubing right now: maybe soon! Also, if you select <math>+</math> for the first equation and <math>-</math> for the second (or vice versa--they lead to the same number), you will always get a real number.
 +
 
 +
One last piece of advice: '''''Don't try to memorize this.''''' Memorize the process (shortcut: just look at TLDR for each section). [[Cubic polynomial|Here]] is another way to do it.
 +
 
 +
===If you're just asking for the formula for a monic cubic...===
 +
 
 +
Here is the formula for <math>x^3 + ax^2 + bx + c</math>:
 +
<math>x = \sqrt[3]{\frac{-\left(\frac{2a^3 - 9ab + 27c}{27}\right) \pm \sqrt{\frac{3\left(\frac{2a^3 - 9ab + 27c}{9}\right)^2 - 4\left(\frac{3b - a^2}{3}\right)^3\left(\frac{2a^3 - 9ab + 27c}{27}\right)}{27}}}{2}} - \sqrt[3]{\frac{\left(\frac{2a^3 - 9ab + 27c}{27}\right) \pm \sqrt{\frac{3\left(\frac{2a^3 - 9ab + 27c}{9}\right)^2 - 4\left(\frac{3b - a^2}{3}\right)^3\left(\frac{2a^3 - 9ab + 27c}{27}\right)}{27}}}{2}} - \frac{a}{3}</math>
 +
 
 +
===If you're asking for the formula for a depressed monic cubic...===
 +
 
 +
Here is the formula for <math>x^3 + ax + b</math>:
 +
<math>x = \sqrt[3]{\frac{-b \pm \sqrt{\frac{27b^2 - 4a^3b}{27}}}{2}} - \sqrt[3]{\frac{b \pm \sqrt{\frac{27b^2 - 4a^3b}{27}}}{2}}</math>
 +
 
 +
[[category:Algebra]]

Latest revision as of 11:16, 27 September 2024

A cubic equation is an equation of the form:

$ax^3 + bx^2 + cx + d = 0$.

A cubic equation has 3 roots, either all real OR one real, two complex.

Solving Cubic Equations

If you're too lazy to follow, look at subsection "TLDR" for each section.

Converting to a Depressed Equation

You start with the equation $ax^3 + bx^2 + cx + d = 0$.

Divide both sides by a: $x^3 + \frac{b}{a}x^2 + \frac{c}{a}x + \frac{d}{a}$.

Now we change the coefficient of $x^2$ to $0$ (e.g. change it to a depressed cubic). We do this by substituting $x = y - \frac{b}{3a}$, giving:

$\left(y - \frac{b}{3a}\right)^3 + \frac{b}{a}\left(y - \frac{b}{3a}\right)^2 + \frac{c}{a}\left(y - \frac{b}{3a}\right) + \frac{d}{a} = 0$

$y^3 - \left(\frac{b}{a}\right)y^2 + \left(\frac{b^2}{3a^2}\right)y - \left(\frac{b^3}{27a^3}\right) + \left(\frac{b}{a}\right)y^2 - \left(\frac{2b^2}{3a^2}\right)y + \left(\frac{b^3}{9a^3}\right) + \left(\frac{c}{a}\right)y - \left(\frac{9abc}{27a^3}\right) + \left(\frac{27a^2d}{27a^3}\right)$

$y^3 + \left(\frac{3ac - b^2}{3a^2}\right)y + \left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) = 0$.

$\left(\frac{3ac - b^2}{3a^2}\right)$ is $p$ and $\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)$ is $q$, so now we have $y^3 + py + q = 0$.

TLDR?

The equation is $y^3 + py + q = 0$ where $p = \left(\frac{3ac - b^2}{3a^2}\right)$ and $q = \left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)$.

Solving the Depressed Equation

Now here comes the smart part. Substitute $y = \sqrt[3]{u} - \sqrt[3]{v}$.

The equation becomes $u - 3\sqrt[3]{u^2v} + 3\sqrt[3]{uv^2} - v + p\sqrt[3]{u} - p\sqrt[3]{v} + q = 0$. Simplification:

$u - v + 3\sqrt[3]{uv^2} - 3\sqrt[3]{u^2v} + p\sqrt[3]{u} - p\sqrt[3]{v} + q = 0$

$u - v - (3\sqrt[3]{uv} - p)(\sqrt[3]{u} - \sqrt[3]{v}) = -q$

We want that last term to equal $0$, so we can set $3\sqrt[3]{uv} - p = 0$. (We can't use $\sqrt[3]{u} - \sqrt[3]{v} = 0$, because then $y = 0$, which is not necessarily true.) Solving this equation gives us $uv = \frac{p^3}{27}$. If $uv = \frac{p^3}{27}$, then $v - u = q$. We now have a system of equations:

$\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}$.

We can solve this via the quadratic formula. After $u$ and $v$ are obtained, we have $y = \sqrt[3]{u} - \sqrt[3]{v}$ and $x = \sqrt[3]{u} - \sqrt[3]{v} - \frac{b}{3a}$.

TLDR?

$x = \sqrt[3]{u} - \sqrt[3]{v} - \frac{b}{3a}$ where u and v are roots of the system $\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}$.

The Cubic formula

The cubic formula can be obtained by using the above method. These are the steps:

The depressed cubic is of the form $y^3 + \left(\frac{3ac - b^2}{3a^2}\right)y + \left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) = 0$.

$u$ and $v$ are the roots of the system of equations $\begin{cases} uv = \frac{p^3}{27} \\ v - u = q \end{cases}$. We can solve this by substitution:

$v = q + u$ (We are still using p and q because they might get a little messy if we use p and q in terms of a, b, c, and d.)

$u(q + u) = \frac{p^3}{27}$

$u^2 + qu - \frac{p^3}{27} = 0$

$u = \frac{-q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}$

$v = \frac{q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}$ (comes from $q + u$)

$y = \sqrt[3]{\frac{-q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}} - \sqrt[3]{\frac{q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}}$

$x = \sqrt[3]{\frac{-q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}} - \sqrt[3]{\frac{q \pm \sqrt{\frac{27q^2 - 4p^3q}{27}}}{2}} - \frac{b}{3a}$

$x = \sqrt[3]{\frac{-\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) \pm \sqrt{\frac{3\left(\frac{2b^3 - 9abc + 27a^2d}{9a^3}\right)^2 - 4\left(\frac{3ac - b^2}{3a^2}\right)^3\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)}{27}}}{2}}$

$- \sqrt[3]{\frac{\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right) \pm \sqrt{\frac{3\left(\frac{2b^3 - 9abc + 27a^2d}{9a^3}\right)^2 - 4\left(\frac{3ac - b^2}{3a^2}\right)^3\left(\frac{2b^3 - 9abc + 27a^2d}{27a^3}\right)}{27}}}{2}} - \frac{b}{3a}$

(See? I told you it would be messy.) I'm not going to simplify all that squaring and cubing right now: maybe soon! Also, if you select $+$ for the first equation and $-$ for the second (or vice versa--they lead to the same number), you will always get a real number.

One last piece of advice: Don't try to memorize this. Memorize the process (shortcut: just look at TLDR for each section). Here is another way to do it.

If you're just asking for the formula for a monic cubic...

Here is the formula for $x^3 + ax^2 + bx + c$: $x = \sqrt[3]{\frac{-\left(\frac{2a^3 - 9ab + 27c}{27}\right) \pm \sqrt{\frac{3\left(\frac{2a^3 - 9ab + 27c}{9}\right)^2 - 4\left(\frac{3b - a^2}{3}\right)^3\left(\frac{2a^3 - 9ab + 27c}{27}\right)}{27}}}{2}} - \sqrt[3]{\frac{\left(\frac{2a^3 - 9ab + 27c}{27}\right) \pm \sqrt{\frac{3\left(\frac{2a^3 - 9ab + 27c}{9}\right)^2 - 4\left(\frac{3b - a^2}{3}\right)^3\left(\frac{2a^3 - 9ab + 27c}{27}\right)}{27}}}{2}} - \frac{a}{3}$

If you're asking for the formula for a depressed monic cubic...

Here is the formula for $x^3 + ax + b$: $x = \sqrt[3]{\frac{-b \pm \sqrt{\frac{27b^2 - 4a^3b}{27}}}{2}} - \sqrt[3]{\frac{b \pm \sqrt{\frac{27b^2 - 4a^3b}{27}}}{2}}$