Difference between revisions of "Simplify"

From TORI
Jump to navigation Jump to search
 
m (Text replacement - "\$([^\$]+)\$" to "\\(\1\\)")
 
Line 11: Line 11:
 
Several conditions can be combined, for example
 
Several conditions can be combined, for example
   
conditions$=${condition1, condition2, ..}
+
conditions\(=\){condition1, condition2, ..}
   
 
in the most of cases, [[Simplify]] returns expression, equivalent to its argument;
 
in the most of cases, [[Simplify]] returns expression, equivalent to its argument;
Line 35: Line 35:
 
The last line returns the same expression as
 
The last line returns the same expression as
   
$\sqrt{1+x}\sqrt{1-x}$
+
\(\sqrt{1+x}\sqrt{1-x}\)
   
Specification of $x$ may allow the simplification:
+
Specification of \(x\) may allow the simplification:
   
 
h[x_] = Simplify[f[x], x > 0]
 
h[x_] = Simplify[f[x], x > 0]
Line 43: Line 43:
 
leads to non-equivalent expression
 
leads to non-equivalent expression
   
$\sqrt{1-x^2}$
+
\(\sqrt{1-x^2}\)
   
that coincides with initial expression for positive $x$, and in this sense is correct.
+
that coincides with initial expression for positive \(x\), and in this sense is correct.
   
 
However, the result of the conditional simplification may be not valid for values of parameters out of range, declared at the call of [[Simplify]]:
 
However, the result of the conditional simplification may be not valid for values of parameters out of range, declared at the call of [[Simplify]]:
Line 57: Line 57:
 
1.27202 - 0.786151 I
 
1.27202 - 0.786151 I
   
(In Mathemaica, capital "I" denotes $\mathrm i=\sqrt{-1}$.
+
(In Mathemaica, capital "I" denotes \(\mathrm i=\sqrt{-1}\).
   
 
==Not perfect==
 
==Not perfect==

Latest revision as of 18:45, 30 July 2019

Simplify is command, operator in the Mathematica language.

Usually, the call of this routine has form

Simplify[expresson]

or

Simplify[expresson, conditions]

Several conditions can be combined, for example

conditions\(=\){condition1, condition2, ..}

in the most of cases, Simplify returns expression, equivalent to its argument; and often, it is written in a form, shorter than its argument.


Example of inconditional simplification

Simplify[2 Sin[x] Cos[x]]

returns

Sin[2 x]

Example of conditional simplification

Sometimes, the simplification is valid only for certain range of values of parameters. The simple example is below.

f[x_] = Sqrt[1 + x] Sqrt[1 - x]

g[x_] = Simplify[f[x]]

The last line returns the same expression as

\(\sqrt{1+x}\sqrt{1-x}\)

Specification of \(x\) may allow the simplification:

h[x_] = Simplify[f[x], x > 0]

leads to non-equivalent expression

\(\sqrt{1-x^2}\)

that coincides with initial expression for positive \(x\), and in this sense is correct.

However, the result of the conditional simplification may be not valid for values of parameters out of range, declared at the call of Simplify:

g[-1.+I] gives the same as f[-1.+I], id est,

1.27202 + 0.786151 I

while h[-1.+I] gives

1.27202 - 0.786151 I

(In Mathemaica, capital "I" denotes \(\mathrm i=\sqrt{-1}\).

Not perfect

In some cases, the rules, used in the implementation of the Simplify command, are not sufficient to perform the simplification.

For example,

Simplify[Integrate[(BesselJ[0, BesselJZero[0,1] p]/(1-p^2) )^2 p , {p,0,Infinity}]]

gives complicated expression

-(1/2) Sqrt[Pi] MeijerG[{{}, {1/2}}, {{0, 1}, {0}}, BesselJZero[0, 1]^2]

instead of just 1/2 .

References


Keywords

Bessel function, BesselJ, Mathematica