maple_as_manipulator.mws

Maple as a analytical tool maple_as_manipulator.mws (7/30/02, updated 7/3/04)

Copyright 2002-2005, SUNY at Buffalo.

Maple can do algebra and calculus.

Solve an equation:

> my_equation := x + y^2*x = 9;
solve(my_equation,x);

my_equation := x+y^2*x = 9

9/(1+y^2)

If there are multiple solutions, you'll need to pick out the one you want:

> solutions:=solve(my_equation,y);
solutions[1];

solutions[2];
solutions := sqrt(-x*(x-9))/x, -sqrt(-x*(x-9))/x

sqrt(-x*(x-9))/x

-sqrt(-x*(x-9))/x

Maple can also deal with systems of equations:

> restart:
eq1:=3*x+y*y=2;

eq2:=7*x-9*y=-1;

solve({eq1,eq2},{x,y});

solutions:=allvalues(%);

eq1 := 3*x+y^2 = 2

eq2 := 7*x-9*y = -1

{y = RootOf(27*_Z-17+7*_Z^2, label = _L1), x = 9/7*RootOf(27*_Z-17+7*_Z^2, label = _L1)-1/7}

solutions := {y = -27/14+1/14*sqrt(1205), x = -257/98+9/98*sqrt(1205)}, {y = -27/14-1/14*sqrt(1205), x = -257/98-9/98*sqrt(1205)}

You can pick out the solution(s) you want like this:

> solutions[1];

{y = -27/14+1/14*sqrt(1205), x = -257/98+9/98*sqrt(1205)}

> eval([x,y],solutions[1]);
%[1];

[-257/98+9/98*sqrt(1205), -27/14+1/14*sqrt(1205)]

-257/98+9/98*sqrt(1205)

> assign(solutions[2]);
x;

y;

-257/98-9/98*sqrt(1205)

-27/14-1/14*sqrt(1205)

Maple can differentiate and integrate:

> restart:
y:=sin(x)+x^2;

y := sin(x)+x^2

> diff(y,x);

cos(x)+2*x

> int(y,x);

-cos(x)+1/3*x^3

> int(y,x=0..Pi);

2+1/3*Pi^3

The assuming operator is sometimes useful:

> sqrt(x^2);

(x^2)^(1/2)

> sqrt(x^2) assuming x>0;

x

> int(exp(-a*x^2),x=0..infinity);
int(exp(-a*x^2),x=0..infinity) assuming a>0;

limit(1/2*Pi^(1/2)*erf(a^(1/2)*x)/a^(1/2), x = infinity)

Pi^(1/2)/(2*a^(1/2))

>