此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)
Mathematica HowTo
How to | Refine and Simplify Expressions
Mathematica provides tools to simplify a diverse range of mathematical expressions to make them easier to understand, or more efficient and robust to compute with.
You might recognize this as a classic example of an expression with a simpler form, namely |x|. However, with a variable, it is left alone:
In[1]:=
Click for copyable input
Out[1]=
If you use a number instead of a variable, this simplifies as you would expect:
In[2]:=
Click for copyable input
Out[2]=
Use Refine to simplify this expression as though x were a real number by using Element and Reals:
In[3]:=
Click for copyable input
Out[3]=
    
Simplify can also be used to this end. The primary difference between Refine and Simplify is this: Refine must have assumptions and performs only those basic simplifications which would be automatic for numeric inputs, while Simplify performs a wider range of simplifications and may be used without assumptions.
Mathematica does not simplify sin^2(x)+cos^2(x) automatically:
In[4]:=
Click for copyable input
Out[4]=
Simplify gives you this familiar identity:
In[5]:=
Click for copyable input
Out[5]=