| ||||||||||||||||||
Simplifiers
UltimaCalc's Algebra module is built around an automatic simplifier. However, there are other simplifiers for specialised purposes:
Rational Expressions
A rational expression is basically one expression divided by another, as distinct from a sum of expressions.
ratsimp(expr)
Rational simplify: This attempts to transform an algebraic expression into the form of a numerator expression divided by a denominator expression, with the numerator and denominator having no factors in common.
For example, (x*x + 4*x + 3)/(x*x + 3*x + 2) is automatically simplified
to (3 + 4*x + x^2)/(2 + 3*x + x^2), but ratsimp((x*x + 4*x + 3)/(x*x + 3*x + 2)) removes
a factor common to numerator and denominator, and simplifies the expression to (3 + x)/(2 + x).
Examples:
ratsimp((a*a-b*b)/(a*a + a*c - a*b - c*b)) gives the result (a + b)/(a + c).
ratsimp((1/(2/3 + x) + 1/(4/5 + x/7))) returns (154 + 120*x)/(56 + 94*x + 15*x^2).
Trigonometric Expressions
trigsimp(expr)
This takes an expression containing trigonometric functions and attempts to convert it into a simplified form. This function also works with expressions containing hyperbolic functions. See trigonometric expressions.
For example, trigsimp((cos(x) + sin(x))^4 + (cos(x) - sin(x))^4) gives the
result 3 - cos(4*x).
Compare with: trigsimp((cosh(x) + sinh(x))^4 + (cosh(x) - sinh(x))^4) which
gives 2*cosh(4*x).
This function is built upon trigexpand and trigcontract.
trigexpand(expr)
This attempts to performs transformations such as:
trigexpand(sin(3*x)) returns 3*cos(x)^2*sin(x) - sin(x)^3,
trigexpand(cosh(3*x)) returns cosh(x)^3 + 3*cosh(x)*sinh(x)^2.
trigcontract(expr)
This attempts to perform the inverse of trigexpand. For
example, trigcontract(4*cos(x)^3) returns 3*cos(x) + cos(3*x) and trigcontract(4*sinh(x)^3) returns -3*sinh(x) + sinh(3*x).
Exponential Expressions
expsimp
This attempts to simplify expressions using the exponential function, exp. This simplifier is built upon expexpand and expcontract. See exponential expressions.
expexpand(expr)
This attempts to perform conversions such
as expexpand(exp(2*x)*exp(y)) returning exp(x)^2*exp(y).
See exponential expressions.
expcontract(expr)
This attempts to perform conversions such as expcontract(exp(2*x)*exp(y)) returning exp(2*x + y). See exponential expressions.
