Mathematica FullSimplify[Sqrt[5+2 Sqrt[6]]] 产生 Sqrt[2]+Sqrt[3] 但 FullSimplify[-Sqrt[5+2 Sqrt[6]]] 未简化,为什么?

发布于 2024-12-22 00:03:42 字数 1014 浏览 3 评论 0原文

我正在玩(美丽的)多项式x^4 - 10x^2 + 1。 看看会发生什么:

 In[46]:= f[x_] := x^4 - 10x^2 + 1
          a = Sqrt[2];
          b = Sqrt[3];
          Simplify[f[ a + b]]
          Simplify[f[ a - b]]
          Simplify[f[-a + b]]
          Simplify[f[-a - b]]
 Out[49]= 0
 Out[50]= 0
 Out[51]= 0
 Out[52]= 0

 In[53]:= Solve[f[x] == 0, x]
 Out[53]= {{x->-Sqrt[5-2 Sqrt[6]]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[5+2 Sqrt[6]]}}
 In[54]:= Simplify[Solve[f[x] == 0, x]]
 Out[54]= {{x->-Sqrt[5-2 Sqrt[6]]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[5+2 Sqrt[6]]}}
 In[55]:= FullSimplify[Solve[f[x] == 0, x]]
 Out[55]= {{x->Sqrt[2]-Sqrt[3]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[2]+Sqrt[3]}}

Sqrt[5-2 Sqrt[6]] 等于 Sqrt[3]-Sqrt[2]
但是,Mathematica 的 FullSimplify 不会简化 Sqrt[5-2 Sqrt[6]]

问题:我应该使用其他更专业的函数来代数求解方程吗?如果有,是哪一个?

I was playing with the (beautiful) polynomial x^4 - 10x^2 + 1.
Look what happens:

 In[46]:= f[x_] := x^4 - 10x^2 + 1
          a = Sqrt[2];
          b = Sqrt[3];
          Simplify[f[ a + b]]
          Simplify[f[ a - b]]
          Simplify[f[-a + b]]
          Simplify[f[-a - b]]
 Out[49]= 0
 Out[50]= 0
 Out[51]= 0
 Out[52]= 0

 In[53]:= Solve[f[x] == 0, x]
 Out[53]= {{x->-Sqrt[5-2 Sqrt[6]]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[5+2 Sqrt[6]]}}
 In[54]:= Simplify[Solve[f[x] == 0, x]]
 Out[54]= {{x->-Sqrt[5-2 Sqrt[6]]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[5+2 Sqrt[6]]}}
 In[55]:= FullSimplify[Solve[f[x] == 0, x]]
 Out[55]= {{x->Sqrt[2]-Sqrt[3]},{x->Sqrt[5-2 Sqrt[6]]},{x->-Sqrt[5+2 Sqrt[6]]},{x->Sqrt[2]+Sqrt[3]}}

Sqrt[5-2 Sqrt[6]] is equal to Sqrt[3]-Sqrt[2].
However, Mathematica's FullSimplify does not simplify Sqrt[5-2 Sqrt[6]].

Question: Should I use other more specialized functions to algebraically solve the equation? If so, which one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

來不及說愛妳 2024-12-29 00:03:42

事实上,Solve 并没有最大限度地简化所有根:

在此处输入图像描述

A < code>FullSimplify 后处理步骤简化了两个根并保持另外两个不变:

在此处输入图像描述

最初发生的情况与Roots

在此处输入图像描述

很奇怪,现在 FullSimplify 简化了所有根:

在此处输入图像描述

我认为,这样做的原因是对于默认的 ComplexityFunction上面用嵌套部首写的一些解决方案在某种意义上比其他解决方案更简单。

顺便说一句 FunctionExpand 知道如何处理这些偏旁部首:

在此处输入图像描述

在此处输入图像描述

Indeed, Solve doesn't simplify all roots to the max:

enter image description here

A FullSimplify postprocessing step simplifies two roots and leaves two others untouched:

enter image description here

Same initially happens with Roots:

enter image description here

Strange enough, now FullSimplify simplifies all roots:

enter image description here

The reason for this is, I assume, that for the default ComplexityFunction some of the solutions written above in nested radicals are in a sense simpler than the others.

BTW FunctionExpand knows how to deal with those radicals:

enter image description here

enter image description here

初心 2024-12-29 00:03:42
FullSimplify[ Solve[x^4-10x^2+1==0,x]
, 
  ComplexityFunction -> 
   (StringLength[ToString[
      InputForm[#1]]] & )]

给出

{{x -> Sqrt[2] - Sqrt[3]}, {x -> -Sqrt[2] + Sqrt[3]}, {x -> -Sqrt[2] -
 Sqrt[3]}, {x -> Sqrt[2] + Sqrt[3]}}
FullSimplify[ Solve[x^4-10x^2+1==0,x]
, 
  ComplexityFunction -> 
   (StringLength[ToString[
      InputForm[#1]]] & )]

gives

{{x -> Sqrt[2] - Sqrt[3]}, {x -> -Sqrt[2] + Sqrt[3]}, {x -> -Sqrt[2] -
 Sqrt[3]}, {x -> Sqrt[2] + Sqrt[3]}}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文