
simplify - simplify expressions

Calling sequence:
simplify(e [ , fn ])

Parameters:
e   --   expression
fn  --   function name (for example exp or sqrt)

Overloading:

1

Summary:

simplify(e) returns a simplified expression which is mathematically equivalent
to e. This function can be overloaded for user-defined domains: if the user
has defined a domain D, and if e is an object of that domain, then the function
D::simplify will be called if it exists. With a second argument, simplify
calls a special simplification routine for some class of expressions.

>>  simplify(sqrt(4+2*sqrt(3)),sqrt);

                            1/2
                           3    + 1

>>  simplify((exp(x)-1)/(exp(x/2)+1),exp);

                            /x\
                          exp--- - 1
                            \2/

>>  D:=domain():
    e:=new(D,x^2-1):
    D::simplify:=proc(x) begin extsubsop(x,1=Factor(extop(x,1))) end_proc:
    simplify(e);

                  new(domain( ), (x - 1) (x + 1))

See also:  combine , expand , radsimp

