找回密码
 快速注册
搜索
查看: 842|回复: 7

三次方程求根公式的三角函数形式

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2021-4-11 22:29 |阅读模式
TrigSolve=((q Sqrt[-4/(3q)]Cos[1/3 ArcCos[-3r/(2q)Sqrt[3/-q]]+2Pi/3{0,1,2}]-b/(3a))/.{q->-(b^2/(3 a^2))+c/a,r->-(b^3/(27 a^3))+b^3/(9 a)-(b c)/3+d/a})/.Thread[{d,c,b,a}->CoefficientList[#1,#2]]&;

示例:
g[x_] = x^3 - 3 x + 1; TrigSolve[g[x], x]
输出\[\left\{-2 \cos \left(\frac{\pi }{9}\right),2 \cos \left(\frac{2 \pi }{9}\right),2 \sin \left(\frac{\pi }{18}\right)\right\}\]验证:
Simplify[g/@%]
输出
{0,0,0}

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2021-4-15 01:07
本帖最后由 hbghlyj 于 2021-4-15 01:15 编辑 这个东西应该只适用于方程有三个实根的情况.
比如
g[x_] = 2 - 9 x - 4 x^2 + 12 x^3; Chop[N[g /@ TrigSolve[g[x], x]]]
输出
{150.062, 150.062, 150.062}
都不是0,说明公式失效
为何三个数值相等呢?

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2021-4-15 01:18
改用维基教科书上的公式写成代码如下:
TrigSolve =
Module[{L, Q, R, \[CapitalDelta], \[Theta]},
   L = CoefficientList[#1, #2]; {c, b, a} = Delete[L/L[[4]], 4];
   Q = (3 b - a^2)/9;
   R = (9 a b - 27 c - 2 a^3)/54; \[CapitalDelta] =
    Q^3 + R^2; \[Theta] = ArcCos[R/Sqrt[-Q^3]];
   2 Sqrt[-Q] Cos[\[Theta]/3 + 2 Pi/3 {0, 1, 2}] - a/3] &;
再测试2#的例子,这回都是0,说明公式在方程有两个虚根时仍然适用.

评分

参与人数 1威望 +3 收起 理由
青青子衿 + 3 谢谢分享!

查看全部评分

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2022-3-17 03:28
发现ComplexExpand可以把根式化成三角函数形式:
In:=
       ComplexExpand[ToRadicals[Root[#^3 - 3 # + 1 &, 1]]]
Out:=
       $-2 \cos \left(\frac{\pi }{9}\right)$

但是有的时候需要手动用辅助角继续化简:
In:=
       ComplexExpand[ToRadicals[Root[-1+21 #1-35 #1^2+7 #1^3&,1]]]
Out:=
       $\frac{5}{3}-\frac{4}{3}\cos \left(\frac{1}{3} \tan ^{-1}\left(\frac{3 \sqrt{3}}{13}\right)\right)-\frac{4 \sin \left(\frac{1}{3} \tan ^{-1}\left(\frac{3 \sqrt{3}}{13}\right)\right)}{\sqrt{3}}$
In:=
       %/. (A_ : 1) Cos[t_] + (B_ : 1) Sin[t_] :> Sqrt[A^2 + B^2] Cos[t - ArcTan[A, B]]
Out:=
       $\frac{5}{3}-\frac{8}{3} \sin \left(\frac{\pi }{6}+\frac{1}{3} \tan ^{-1}\left(\frac{3 \sqrt{3}}{13}\right)\right)$

更有甚者,需要先用TrigReduce,再手动用辅助角化简:
In:=
       ComplexExpand[ToRadicals[Root[#^3-6 #+1&,1]]]
Out:=
       $-\frac{\text{Cos}\left[\frac{1}{3} \left(\pi
   -\text{ArcTan}\left[\sqrt{31}\right]\right)\right]}{\sqrt{2}}-\frac{\text{Cos}\left[\frac{1}{3} \left(-\pi
   +\text{ArcTan}\left[\sqrt{31}\right]\right)\right]}{\sqrt{2}}-\sqrt{\frac{3}{2}} \text{Sin}\left[\frac{1}{3}
   \left(\pi -\text{ArcTan}\left[\sqrt{31}\right]\right)\right]+\sqrt{\frac{3}{2}} \text{Sin}\left[\frac{1}{3}
   \left(-\pi +\text{ArcTan}\left[\sqrt{31}\right]\right)\right]$
       $+i \left(\sqrt{\frac{3}{2}} \text{Cos}\left[\frac{1}{3}
   \left(\pi -\text{ArcTan}\left[\sqrt{31}\right]\right)\right]-\sqrt{\frac{3}{2}} \text{Cos}\left[\frac{1}{3}
   \left(-\pi +\text{ArcTan}\left[\sqrt{31}\right]\right)\right]-\frac{\text{Sin}\left[\frac{1}{3} \left(\pi
   -\text{ArcTan}\left[\sqrt{31}\right]\right)\right]}{\sqrt{2}}-\frac{\text{Sin}\left[\frac{1}{3} \left(-\pi
   +\text{ArcTan}\left[\sqrt{31}\right]\right)\right]}{\sqrt{2}}\right)$
In:=
       % // TrigReduce
Out:=
       $-\sqrt{6} \text{Cos}\left[\frac{\pi
   }{6}+\frac{\text{ArcTan}\left[\sqrt{31}\right]}{3}\right]-\sqrt{2} \text{Sin}\left[\frac{\pi
   }{6}+\frac{\text{ArcTan}\left[\sqrt{31}\right]}{3}\right]$
In:=
       %/. (A_ : 1) Cos[t_] + (B_ : 1) Sin[t_] :> Sqrt[A^2 + B^2] Cos[t - ArcTan[A, B]]
Out:=
       $-2 \sqrt{2}
   \text{Cos}\left[\frac{\text{ArcTan}\left[\sqrt{31}\right]}{3}\right]$

点评

ComplexExpand[ToRadicals[Root[#^3-6 #+1&,1]]] 前面加上Simplify@,就能直接得到最简结果了。  发表于 2022-10-6 19:41

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2022-8-13 01:24
Trigonometric solution in terms of real quantities
While casus irreducibilis cannot be solved in radicals in terms of real quantities, it can be solved trigonometrically in terms of real quantities.[7] Specifically, the depressed monic cubic equation $t^{3}+pt+q=0$ is solved by
$$ t_{k}=2{\sqrt {-{\frac {p}{3}}}}\cos \left[{\frac {1}{3}}\arccos \left({\frac {3q}{2p}}{\sqrt {\frac {-3}{p}}}\right)-k{\frac {2\pi }{3}}\right]\quad {\text{for}}\quad k=0,1,2\,.$$
These solutions are in terms of real quantities if and only if ${q^{{2}} \over 4}+{p^{{3}} \over 27}<0$ — i.e., if and only if there are three real roots. The formula involves starting with an angle whose cosine is known, trisecting the angle by multiplying it by 1/3, and taking the cosine of the resulting angle and adjusting for scale.

Although cosine and its inverse function (arccosine) are transcendental functions, this solution is algebraic in the sense that ${\displaystyle \cos \left[\arccos \left(x\right)/3\right]}$ is an algebraic function, equivalent to angle trisection.

   REFERENCE   
[7] Cox, David A. (2012), Galois Theory, Pure and Applied Mathematics (2nd ed.), John Wiley & Sons,
Section 1.3B Trigonometric Solution of the Cubic, pp. 18–19.

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2022-8-16 01:37
ursoswald.ch/download/CUBIC.pdf
Theorem 10
(i) $w_{1}=\sinh \left(\frac{1}{3} \operatorname{arsinh} C\right)$ if $p>0$,
(ii) $w_{1}=\left\{\begin{array}{ll}\cosh \left(\frac{1}{3} \operatorname{arcosh} C\right) & \text { if } p<0 \text { and } C \geq 1 \\ -\cosh \left(\frac{1}{3} \operatorname{arcosh}(-C)\right) & \text { if } p<0 \text { and } C \leq-1\end{array}\right.$,
(iii) $w_{k}=\cos \left(\frac{1}{3} \arccos C+(k-1) \cdot \frac{2 \pi}{3}\right)$, where $k=1,2,3$ if $p<0$ and $|C| \leq 1$.

471

主题

945

回帖

9837

积分

积分
9837

显示全部楼层

青青子衿 发表于 2024-5-21 21:53


下面的这个结论正确吗?
{AA -> b^2 - 3*a*c,
BB -> b*c - 9*a*d,
CC -> c^2 - 3*b*d};
Delta = BB^2-4*AA*CC;

当Delta>0
三次方程a*t^3+b*t^2+c*t+d=0有一个实根和两个共轭复根

当Delta=0
当A≠B时,
三次方程a*t^3+b*t^2+c*t+d=0有一个单实根和一对二重实根
当A=B=0时,
三次方程a*t^3+b*t^2+c*t+d=0有三重实根
当A=B≠0时,
三次方程a*t^3+b*t^2+c*t+d=0有一个单实根和一对二重实根

当Delta<0
三次方程a*t^3+b*t^2+c*t+d=0有三个相异的单实根

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 07:15

Powered by Discuz!

× 快速回复 返回顶部 返回列表