Skip to content

Latest commit

 

History

History
132 lines (94 loc) · 4.51 KB

File metadata and controls

132 lines (94 loc) · 4.51 KB

1元3次等式的求根过程

开始做实体实验

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

$$ => \frac{ax^3 + bx^2 + cx + d}a = \frac{0}{a} $$

$$ => \frac{a}{a}x^3 + \frac{b}{a}x^2 + \frac{c}{a}x + \frac{d}{a} = 0 $$

$$ => x^3 + \frac{b}{a}x^2 + \frac{c}{a}x + \frac{d}{a} = 0 $$

$\frac{b}{a} = b', \frac{c}{a} = c', \frac{d}{a} = d' $, 代入到上面的等式:

$$ => x^3 + b'x^2 + c'x + d' = 0 $$

$x = z - \frac{b'}{3} $, 代入到上面的等式:

$$ => (z-\frac{b'}{3})^3 + b'(z-\frac{b'}{3})^2 + c'(z-\frac{b'}{3}) + d' = 0 $$

$$ => (z^3-b'z^2+\frac{(b')^2}{3}z-\frac{(b')^3}{27})+(b'z^2-\frac{2(b')^2}{3})z+\frac{(b')^3}{9}+(c'z-\frac{b'c'}{3})+d'=0 $$

$$ => z^3-(\frac{(b')^2}{3}-c')z+\frac{(b')^3}{27}-\frac{b'c'}{3}+d'=0 $$

$$ => z^3 - (\frac{(\frac{b}{a})^2}{3}-\frac{c}{a})z + \frac{\frac{2b^3}{a^3}}{27} - \frac{\frac{bc}{a^2}}{3} + \frac{d}{a} = 0 $$

$$ => z^3 + \frac{3ac-b^2}{3a^2} + \frac{2b^3+27a^2d-9abc}{27a^3} = 0 $$

$\frac{3ac-b^2}{3a^2}=p, \frac{2b^3+27a^2d-9abc}{27a^3}=q $, 代入到上面的等式:

$$ => z^3 + pz + q = 0 $$

$$ (u+v)^3=u^3+3u^2v+3uv^2+v^3=u^3+v^3+3uv(u+v) => (u+v)^3 - 3uv(u+v) - (u^3+v^3) = 0 $$

$$ \left\{ \begin{array}{c} z = u+v\\\ p = -3uv\\\ q = -(u^3+v^3)\\\ \end{array} \right. $$

又因为: $(u^3-v^3)^2 = u^6+v^6-2u^3v^3 = u^6+v^6+2u^3v^3-4u^3v^3 =(u^3+v^3)^2-4u^3v^3$

$$ => (u^3-v^3)^2 = (u^3+v^3)^2-4u^3v^3 $$ $$ => (u^3-v^3)^2 = (-q)^2-4(uv)^3 $$ $$ => (u^3-v^3)^2 = (-q)^2-4(\frac{p}{3})^3 $$ $$ => (u^3-v^3)^2 = (-q)^2-\frac{4p^3}{27} $$ $$ => u^3-v^3 = ±\sqrt{(-q)^2-\frac{4p^3}{27}} $$

$$ \left\{ \begin{array}{c} u^3-v^3 = ±\sqrt{(-q)^2-\frac{4p^3}{27}}\\\ u^3+v^3 = -q\\\ \end{array} \right. $$

$$ \left\{ \begin{array}{c} u^3 = -\frac{q}{2}+\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}\\\ v^3 = -\frac{q}{2}+\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}\\\ \end{array} \right. $$

$$ \left\{ \begin{array}{c} u = \sqrt[3]{-\frac{q}{2}+\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}\\\ v = \sqrt[3]{-\frac{q}{2}-\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}\\\ \end{array} \right. $$

$$ => z=u+v=\sqrt[3]{-\frac{q}{2}+\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}}+\sqrt[3]{-\frac{q}{2}-\sqrt{\frac{q^2}{4}+\frac{p^3}{27}}} $$

开始做代码实验

  • 单机右方的Python Online Compiler,稍后在浏览器里会显示python的运行环境。
  • 把下面的这段python代码拷贝到这个页面“Run Code”下侧的深蓝色的空白栏中, 然后单击上方的按键“Run Code”。

y = 2x3 - 3x2 - 3x + 2 的轮廓与x轴的交点就是y = 2x3的轮廓和y = 3x2 + 3x - 2的轮廓的交点

import numpy as np
import matplotlib.pyplot as plt
# plt.gca().set_aspect( 1 ) 

x = np.linspace(-2,3,59) # print(x)
y = 2*x**3 - 3*x**2 - 3*x + 2 # print(y)
plt.scatter(x,y)

# y = 2*x**3
# plt.scatter(x,y)

# y = 3*x**2 + 3*x - 2
# plt.scatter(x,y)

y = x*0
plt.scatter(x,y)

plt.show()

参考文献及资料

  1. 维基百科