(directly go to documentation on : Simplify, RadSimp, FactorialSimplify, LnExpand, LnCombine, TrigSimpCombine.
11. Simplification of expressions
Simplification of expression is a big and non-trivial subject. Simplification implies that there is a preferred form. In practice the preferred form depends on the calculation at hand. This chapter describes the functions offered that allow simplification of expressions.
||try to simplify an expression
||simplify expression with nested radicals
||Simplify hypergeometric expressions containing factorials
||expand a logarithmic expression using standard logarithm rules
||combine logarithmic expressions using standard logarithm rules
||combine products of trigonometric functions
Simplify -- try to simplify an expression
expr -- expression to simplify
This function tries to simplify the expression expr as much
as possible. It does this by grouping powers within terms, and then
grouping similar terms.
RadSimp -- simplify expression with nested radicals
expr -- an expression containing nested radicals
This function tries to write the expression "expr" as a sum of roots
of integers: Sqrt(e1)+Sqrt(e2)+..., where e1, e2 and
so on are natural numbers. The expression "expr" may not contain
It does this by trying all possible combinations for e1, e2, ...
Every possibility is numerically evaluated using N and compared with the numerical evaluation of
"expr". If the approximations are equal (up to a certain margin),
this possibility is returned. Otherwise, the expression is returned
Note that due to the use of numerical approximations, there is a small
chance that the expression returned by RadSimp is
close but not equal to expr. The last example underneath
illustrates this problem. Furthermore, if the numerical value of
expr is large, the number of possibilities becomes exorbitantly
big so the evaluation may take very long.
In> RadSimp(Sqrt(5+2*Sqrt(6)) \
But this command may yield incorrect results:
FactorialSimplify -- Simplify hypergeometric expressions containing factorials
expression -- expression to simplify
FactorialSimplify takes an expression that may contain factorials,
and tries to simplify it. An expression like (n+1)! /n! would
simplify to n+1.
The following steps are taken to simplify:
- binomials are expanded into factorials
- the expression is flattened as much as possible, to reduce it to a sum of simple rational terms
- expressions like p^n/p^m are reduced to p^(n-m) if n-m is an integer
- expressions like n! /m! are simplified if n-m is an integer
The function Simplify is used to determine if the relevant expressions n-m
In> FactorialSimplify( (n-k+1)! / (n-k)! )
In> FactorialSimplify(n! / Bin(n,k))
Out> k! *(n-k)!
LnExpand -- expand a logarithmic expression using standard logarithm rules
expr -- the logarithm of an expression
LnExpand takes an expression of the form Ln(expr), and applies logarithm
rules to expand this into multiple Ln expressions where possible. An
expression like Ln(a*b^n) would be expanded to Ln(a)+n*Ln(b).
If the logarithm of an integer is discovered, it is factorised using Factors
and expanded as though LnExpand had been given the factorised form. So
Ln(18) goes to Ln(x)+2*Ln(3).
LnCombine -- combine logarithmic expressions using standard logarithm rules
expr -- an expression possibly containing multiple Ln terms to be combined
LnCombine finds Ln terms in the expression it is given, and combines them
using logarithm rules. It is intended to be the exact converse of LnExpand.
TrigSimpCombine -- combine products of trigonometric functions
expr -- expression to simplify
This function applies the product rules of trigonometry, e.g.
Cos(u)*Sin(v)=1/2*(Sin(v-u)+Sin(v+u)). As a
result, all products of the trigonometric functions Cos and Sin disappear. The function also tries to simplify the resulting expression as much as
possible by combining all similar terms.
This function is used in for instance Integrate,
to bring down the expression into a simpler form that hopefully can be
Cos( -2 * a )
Sin( b ) Sin( -2 * a + b )
-------- + -----------------
Sin( -2 * a - b )