【问题标题】:How to make Mathematica Simplify Square Root Expression如何使 Mathematica 简化平方根表达式
【发布时间】:2017-06-03 09:03:36
【问题描述】:

我希望 Mathematica 计算平方变量的平方根。相反,它只是返回平方根下的平方变量。我写了一个简单的代码作为例子:

x = y^2
z = FullSimplify[Sqrt[x]]

但它在平方根符号下返回 y^2!

【问题讨论】:

    标签: wolfram-mathematica simplify


    【解决方案1】:

    此行为记录在 Sqrt 参考页面上:

    • Sqrt[z^2] 不会自动转换为 z

    […]

    • 这些转换可以使用PowerExpand 完成,但通常只对正实数参数是正确的。

    因此:

    In[1]:= x = y^2
    
    Out[1]= y^2
    
    In[15]:= PowerExpand[Sqrt[x]]
    
    Out[15]= y
    

    您还可以通过提供各种假设来进行简化:

    In[10]:= Simplify[Sqrt[x], Assumptions -> Element[y, Reals]]
    
    Out[10]= Abs[y]
    
    In[13]:= Simplify[Sqrt[x], Assumptions -> y > 0]
    
    Out[13]= y
    
    In[14]:= Simplify[Sqrt[x], Assumptions -> y < 0]
    
    Out[14]= -y
    

    如果您需要更多帮助,我建议您在the Mathematica Stack Exchange 上提问。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多