# Question:Ease of Manipulating Formulae in Maple

## Question:Ease of Manipulating Formulae in Maple

Maple

I am interested in how easy it is to work with formulae in the Maple language.  For example, you can easily add two equations together with '+'.

 > e1:=x^2+1=2*x;
 (1)
 > e2:=x^3+x=5;
 (2)
 > e1+e2;
 (3)

I was pleased when the following example added (x+1) to both sides of an equation,

 > e3:=x+1;
 (4)
 > e1+e3;
 (5)

Some other algebraic operations work.

 > e1-e3;
 (6)
 > e1*e3;
 (7)
 > e1/e3;
 (8)
 > e1^(1/2);
 (9)

Build-in functions do not work, though, but there is a simple solution.

 > exp(e1);
 > exp(rhs(e1))=exp(lhs(e1));
 (10)
 > map(exp,e1);
 (11)

The methods also apply to inequality formulae.  I'm not as pleased about how it does '*' and '/' for inequalities.  You can get more control using rhs and lhs functions.  Here are some examples:

 > e4:=x^3<5*(x+1);
 (12)
 > e4+e3;
 (13)
 > e4-e3;
 (14)
 > e4*e3;
 (15)
 > e4/e3;
 (16)
 > eval(%,x=4);
 (17)
 > evalb(%);
 (18)
 > (16)/x^2;
 (19)
 > simplify(%);
 (20)
 > lhs(e4)/e3/x^2 < rhs(e4)/e3/x^2;
 (21)
 > simplify(%);
 (22)
 >