>

LESSON 0 - BASIC MAPLE COMMANDS

Dr. K.P.Satagopan

To define a function:

Method I  

> f:= x-> x^2+1;

f := proc (x) options operator, arrow; x^2+1 end proc

To evaluate the function :

> f(2);

5

> f(a);

a^2+1

> f(-3);

10

> f(a+h)-f(a);

(a+h)^2-a^2

> simplify(f(a+h)-f(a))/h;

(2*a*h+h^2)/h

> simplify(%);

2*a+h

The percent sign in the above command denotes the latest output in MAPLE, which in this case is 2a+h

>

Method II

> f(x):= x^2+1;

f(x) := x^2+1

> f(2);

5

> f(a);

a^2+1

>

To factor an expression:

> factor(x^2-3*x+2);

(x-1)*(x-2)

> expand((x-1)*(x-2));

x^2-3*x+2

>

To solve an equation:

> solve(x^2-3*x+2=0,x);

2, 1

> solve(x^2+3*x+3=0,x);

-3/2+1/2*I*3^(1/2), -3/2-1/2*I*3^(1/2)

>

Notice the roots are imaginary.

> solve(x^2+3*y+2*x*y-5=0,y);

-(x^2-5)/(3+2*x)

>

Notice it has solved for 'y' in terms of the other variable 'x'.