Simplify
[expr]Simplify
[expr, assump]$Assumptions
.Simplify[2*Sin[x]^2 + 2*Cos[x]^2]
Simplify[x]
Simplify[f[x]]
Simplify over conditional expressions uses $Assumptions
, or assump
to evaluate the condition:
$Assumptions={a <= 0};
Simplify[ConditionalExpression[1, a > 0]]
The assump option override $Assumption
:
Simplify[ConditionalExpression[1, a > 0] ConditionalExpression[1, b > 0], { b > 0 }]
On the other hand, Assumptions
option does not override $Assumptions
, but add to them:
Simplify[ConditionalExpression[1, a > 0] ConditionalExpression[1, b > 0], Assumptions -> { b > 0 }]
Passing both options overwrites $Assumptions
with the union of assump the option
Simplify[ConditionalExpression[1, a > 0] ConditionalExpression[1, b > 0], {a>0},Assumptions -> { b > 0 }]
$Assumptions={};
The option ComplexityFunction
allows to control the way in which the evaluator decides if one expression is simpler than another. For example, by default, Simplify
tries to avoid expressions involving numbers with many digits:
Simplify[20 Log[2]]
This behaviour can be modified by setting LeafCount
as the ComplexityFunction
:
Simplify[20 Log[2], ComplexityFunction->LeafCount]