Maxima Function
ratsimp (expr)
ratsimp(expr,x_1,...,x_n)
Simplifies the expression expr and all of its subexpressions,
including the arguments to non-rational functions.
The result is returned as the quotient of two polynomials in a recursive form,
that is, the coefficients of the main variable are polynomials in the other variables.
Variables may include non-rational functions (e.g., sin (x^2 + 1)
)
and the arguments to any such functions are also rationally simplified.
ratsimp (expr, x_1, ..., x_n)
enables rational simplification with the
specification of variable ordering as in ratvars
.
When ratsimpexpons
is true
,
ratsimp
is applied to the exponents of expressions during simplification.
See also .
Note that ratsimp
is affected by some of the
flags which affect ratexpand
.
Examples:
(%i1) sin (x/(x^2 + x)) = exp ((log(x) + 1)^2 - log(x)^2); 2 2 x (log(x) + 1) - log (x) (%o1) sin(------) = %e 2 x + x (%i2) ratsimp (%); 1 2 (%o2) sin(-----) = %e x x + 1 (%i3) ((x - 1)^(3/2) - (x + 1)*sqrt(x - 1))/sqrt((x - 1)*(x + 1)); 3/2 (x - 1) - sqrt(x - 1) (x + 1) (%o3) -------------------------------- sqrt((x - 1) (x + 1)) (%i4) ratsimp (%); 2 sqrt(x - 1) (%o4) - ------------- 2 sqrt(x - 1) (%i5) x^(a + 1/a), ratsimpexpons: true; 2 a + 1 ------ a (%o5) x