# 三次方程

${\displaystyle ax^{3}+bx^{2}+cx+d=0}$

## 判别式

${\displaystyle \Delta >0}$时，方程有一个实根和两个共轭複根；

${\displaystyle \Delta =0}$时，方程有三个实根：当

${\displaystyle \left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}=-\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}=0}$

${\displaystyle \left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}=-\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}\neq 0}$

${\displaystyle \Delta <0}$时，方程有三个不等的实根。

## 三次方程解法

### 求根公式法

${\displaystyle ax^{3}+bx^{2}+cx+d=0,a\neq 0}$
${\displaystyle x_{1}=-{\frac {b}{3a}}+{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}+{\sqrt {\color {red}\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}+{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}-{\sqrt {\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}}$
${\displaystyle x_{2}=-{\frac {b}{3a}}+{\frac {-1+{\sqrt {3}}\,{\rm {i}}}{2}}{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}+{\sqrt {\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}+{\frac {-1-{\sqrt {3}}\,{\rm {i}}}{2}}{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}-{\sqrt {\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}}$
${\displaystyle x_{3}=-{\frac {b}{3a}}+{\frac {-1-{\sqrt {3}}\,{\rm {i}}}{2}}{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}+{\sqrt {\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}+{\frac {-1+{\sqrt {3}}\,{\rm {i}}}{2}}{\sqrt[{3}]{{\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}-{\sqrt {\left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}+\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}}}}}}$

${\displaystyle \Delta >0}$时，方程有一个实根和两个共轭複根；

${\displaystyle \Delta =0}$时，方程有三个实根：

${\displaystyle \left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}=-\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}=0}$时，方程有一个三重实根；

${\displaystyle \left({\frac {bc}{6a^{2}}}-{\frac {b^{3}}{27a^{3}}}-{\frac {d}{2a}}\right)^{2}=-\left({\frac {c}{3a}}-{\frac {b^{2}}{9a^{2}}}\right)^{3}\neq 0}$时，方程的三个实根中有两个相等；

${\displaystyle \Delta <0}$时，方程有三个不等的实根。

${\displaystyle ax^{3}+bx^{2}+cx+d=0,a\neq 0}$
${\displaystyle x=-{{b} \over {3a}}+{{{\sqrt[{3}]{2}}\left(b^{2}-3ac\right)} \over {3a\left({{-1+{\sqrt {3}}i} \over {2}}\right)^{k}}{\sqrt[{3}]{9abc-27a^{2}d-2b^{3}+{\sqrt {\left(9abc-27a^{2}d-2b^{3}\right)^{2}-4\left(b^{2}-3ac\right)^{3}}}}}}+{{\left({{-1+{\sqrt {3}}i} \over {2}}\right)^{k}}{\sqrt[{3}]{9abc-27a^{2}d-2b^{3}+{\sqrt {\left(9abc-27a^{2}d-2b^{3}\right)^{2}-4\left(b^{2}-3ac\right)^{3}}}}} \over {3{\sqrt[{3}]{2}}a}},k=0,1,2}$

### 三角函数解

${\displaystyle ax^{3}+bx^{2}+cx+d=0}$，其中${\displaystyle a\neq 0}$

${\displaystyle x_{1}=-{\frac {b}{3a}}+2{\sqrt {-\beta }}\cos \left[{\frac {\arccos {\frac {\alpha }{(-\beta )^{\frac {3}{2}}}}}{3}}\right]}$

${\displaystyle x_{2}=-{\frac {b}{3a}}+2{\sqrt {-\beta }}\cos \left[{\frac {\arccos {\frac {\alpha }{(-\beta )^{\frac {3}{2}}}}+2\pi }{3}}\right]}$

${\displaystyle x_{3}=-{\frac {b}{3a}}+2{\sqrt {-\beta }}\cos \left[{\frac {\arccos {\frac {\alpha }{(-\beta )^{\frac {3}{2}}}}-2\pi }{3}}\right]}$

### 卡尔达诺法

${\displaystyle K}$為域，可以進行開平方或立方運算。要解方程只需找到一個根${\displaystyle r}$，然後把方程${\displaystyle ax^{3}+bx^{2}+cx+d}$除以${\displaystyle x-r}$，就得到一個二次方程，而我們已會解二次方程。

• 把原來方程除以首項係數${\displaystyle a\left(a\neq 0\right)}$，得到：
${\displaystyle x^{3}+b'x^{2}+c'x+d'=0}$，其中${\displaystyle b'={\frac {b}{a}}}$${\displaystyle c'={\frac {c}{a}}}$${\displaystyle d'={\frac {d}{a}}}$
• 代換未知項${\displaystyle x=z-{\frac {b'}{3}}}$，以消去二次項。當展開${\displaystyle \left(z-{\frac {b'}{3}}\right)^{3}}$，會得到${\displaystyle -b'z^{2}}$這項，正好抵消掉出現於${\displaystyle b'\left(z-{\frac {b'}{3}}\right)^{2}}$的項${\displaystyle b'z^{2}}$。故得：
${\displaystyle z^{3}+pz+q=0}$，其中${\displaystyle p}$${\displaystyle q}$是域中的數字。
${\displaystyle p=c'-{\frac {b'^{2}}{3}}}$${\displaystyle q={\frac {2b'^{3}}{27}}-{\frac {b'c'}{3}}+d'}$
• ${\displaystyle u,v}$滿足${\displaystyle 3uv=-p,u^{3}+v^{3}=-q}$,則${\displaystyle u+v}$為解

${\displaystyle z=u+\upsilon }$。前一方程化為${\displaystyle (u+\upsilon )^{3}+p(u+\upsilon )+q=0}$

• ${\displaystyle U=u^{3}}$${\displaystyle V=\upsilon ^{3}}$。我們有${\displaystyle U+V=-q}$${\displaystyle UV=-{\frac {p^{3}}{27}}}$因為${\displaystyle UV=(u\upsilon )^{3}=(-{\frac {p}{3}})^{3}}$。所以${\displaystyle U}$${\displaystyle V}$是輔助方程${\displaystyle \mathrm {X} ^{2}+q\mathrm {X} -{\frac {p^{3}}{27}}=0}$的根，可代一般二次方程公式得解。

#### 判别式

• ${\displaystyle \Delta >0}$，方程有一个实根和两个共轭複根；
• ${\displaystyle \Delta =0}$，方程有三个实根：当${\displaystyle {\frac {q^{2}}{4}}=-{\frac {p^{3}}{27}}=0}$时，方程有一个三重实根；当${\displaystyle {\frac {q^{2}}{4}}=-{\frac {p^{3}}{27}}\neq 0}$时，方程的三个实根中有两个相等；
• ${\displaystyle \Delta <0}$，方程有三个不等的实根：${\displaystyle x_{1}=2{\sqrt {Q}}\cos {\frac {\theta }{3}}-{\frac {b}{3a}},x_{2,3}=2{\sqrt {Q}}\cos {\frac {\theta \pm 2\pi }{3}}-{\frac {b}{3a}},}$其中${\displaystyle \theta =\arccos {\frac {R}{Q{\sqrt {Q}}}},Q=-{\frac {p}{3}},R={\frac {q}{2}}}$（注意，由於此公式應對於${\displaystyle x^{3}+px=q}$的形式，因此這裡的${\displaystyle q}$實際上是前段的${\displaystyle -q}$，應用時務必注意取負號即${\displaystyle R=-{\frac {q}{2}}}$）。

#### 第一個例子

${\displaystyle 2t^{3}+6t^{2}+12t+10=0}$

• ${\displaystyle t^{3}+3t^{2}+6t+5=0}$（全式除以${\displaystyle 2}$
• ${\displaystyle t=x-1}$，代換：${\displaystyle (x-1)^{3}+3(x-1)^{2}+6(x-1)+5=0}$，再展開${\displaystyle x^{3}+3x+1=0}$
• ${\displaystyle x=u+v}$${\displaystyle U=u^{3}}$${\displaystyle V=v^{3}}$。設${\displaystyle U+V=-1}$${\displaystyle UV=-1}$${\displaystyle U}$${\displaystyle V}$${\displaystyle X^{2}+X-1=0}$的根。
${\displaystyle U={\frac {-1-{\sqrt {5}}}{2}}}$${\displaystyle V={\frac {-1+{\sqrt {5}}}{2}}}$
${\displaystyle u={\sqrt[{3}]{\frac {-1-{\sqrt {5}}}{2}}}}$${\displaystyle v={\sqrt[{3}]{\frac {-1+{\sqrt {5}}}{2}}}}$
${\displaystyle t=x-1=u+v-1}$
${\displaystyle ={\sqrt[{3}]{\frac {-1-{\sqrt {5}}}{2}}}+{\sqrt[{3}]{\frac {-1+{\sqrt {5}}}{2}}}-1\approx -1.3221853546}$

${\displaystyle t_{2}\approx -0.838907+1.75438i}$
${\displaystyle t_{3}\approx -0.838907-1.75438i}$

#### 第二个例子

${\displaystyle U+V=4}$${\displaystyle UV=125}$

${\displaystyle U}$${\displaystyle V}$${\displaystyle X^{2}-4X+125=0}$的根。这方程的判别式已算出是负数，所以只有实根。很吊诡地，这方法必须用到复数求出全是实数的根。这是发明复数的一个理由：复数是解方程必需工具，即使方程或许只有实根。

${\displaystyle u^{3}=2-11{\mathrm {i} }}$等价于：
${\displaystyle a^{3}-3ab^{2}=2}$（实部）
${\displaystyle 3a^{2}b-b^{3}=-11}$（虚部）
${\displaystyle a^{2}+b^{2}=5}$（模）

${\displaystyle \Delta }$是负，${\displaystyle U}$${\displaystyle V}$共轭，故此${\displaystyle u}$${\displaystyle v}$也是（要适当选取立方根，记得${\displaystyle uv=-{\frac {p}{3}}}$）；所以我们可确保${\displaystyle x}$是实数，还有${\displaystyle x'}$${\displaystyle x''}$

### 盛金公式法

${\displaystyle ax^{3}+bx^{2}+cx+d=0,a\neq 0}$，其中系数皆为实数。

#### 情况1：${\displaystyle A=B=0}$

${\displaystyle x_{1}=x_{2}=x_{3}={\frac {-b}{3a}}={\frac {-c}{b}}={\frac {-3d}{c}}}$

#### 情况2：${\displaystyle \Delta >0}$

${\displaystyle y_{1,2}=Ab+3a\left({\frac {-B\pm {\sqrt {B^{2}-4AC}}}{2}}\right)}$，得：

${\displaystyle x_{1}={\frac {-b-\left({\sqrt[{3}]{y_{1}}}+{\sqrt[{3}]{y_{2}}}\right)}{3a}}}$

${\displaystyle x_{2}={\frac {-2b+\left({\sqrt[{3}]{y_{1}}}+{\sqrt[{3}]{y_{2}}}\right)+{\sqrt {3}}\left({\sqrt[{3}]{y_{1}}}-{\sqrt[{3}]{y_{2}}}\right){\rm {i}}}{6a}}}$

${\displaystyle x_{3}={\frac {-2b+\left({\sqrt[{3}]{y_{1}}}+{\sqrt[{3}]{y_{2}}}\right)-{\sqrt {3}}\left({\sqrt[{3}]{y_{1}}}-{\sqrt[{3}]{y_{2}}}\right){\rm {i}}}{6a}}}$

#### 情况3：${\displaystyle \Delta =0}$

${\displaystyle k={\frac {B}{A}}\ (A\neq 0)}$，得：

${\displaystyle x_{1}={\frac {-b}{a}}+k}$

${\displaystyle x_{2}=x_{3}={\frac {-k}{2}}}$

#### 情况4：${\displaystyle \Delta <0}$

${\displaystyle t={\frac {2Ab-3aB}{2A{\sqrt {A}}}}\ (A>0,-1，得：

${\displaystyle x_{1}={\frac {-b-2{\sqrt {A}}\cos {\frac {\theta }{3}}}{3a}}}$

${\displaystyle x_{2}={\frac {-b+{\sqrt {A}}\left(\cos {\frac {\theta }{3}}+{\sqrt {3}}\sin {\frac {\theta }{3}}\right)}{3a}}}$

${\displaystyle x_{3}={\frac {-b+{\sqrt {A}}\left(\cos {\frac {\theta }{3}}-{\sqrt {3}}\sin {\frac {\theta }{3}}\right)}{3a}}}$

## 极值

### 驻点的公式

${\displaystyle y=ax^{3}+bx^{2}+cx+d}$

• 有序列表项

### 拐点

${\displaystyle {\frac {d^{2}y}{dx^{2}}}=6ax+2b}$

${\displaystyle {\frac {d^{2}y}{dx^{2}}}=0}$，可得${\displaystyle y}$

${\displaystyle x=-{\frac {b}{3a}}}$

### 驻点的类型

${\displaystyle f^{\prime \prime }(x_{e})<0}$${\displaystyle x_{e}}$${\displaystyle f(x)}$极大值点
${\displaystyle f^{\prime \prime }(x_{e})>0}$${\displaystyle x_{e}}$${\displaystyle f(x)}$极小值点
${\displaystyle f^{\prime \prime }(x_{e})=0}$${\displaystyle x_{e}}$${\displaystyle f(x)}$拐点

${\displaystyle {\frac {d^{2}y}{dx^{2}}}=6ax+2b=2(3ax+b)}$可知：
${\displaystyle 3ax_{e}+b<0}$${\displaystyle y}$的驻点为极大值点；
${\displaystyle 3ax_{e}+b>0}$${\displaystyle y}$的驻点为极小值点；
${\displaystyle 3ax_{e}+b=0}$${\displaystyle y}$的驻点为拐点。

## 參考資料

1. ^ 三上义夫 《中国算学之特色》 34页 商务印书馆。