A GUIDE TO MAPLE
LESSON 1

1. Define an expression:  f  =  x^2 + 2*x - 5.

>  f:=x^2 + 2*x - 5;

f := x^2+2*x-5

1a. Obtain the first-order and second-order derivatives of the function.

> f1:=diff(f,x);

f1 := 2*x+2

> f11:=diff(f1,x);

f11 := 2

1b. Plot the function. Specify ranges for x and z.

> plot(f, x=0..10, z=-20..100);

[Plot]

1c. Substitute a value for x in the function.

> subs(x=4,f);

19

2. Solve two equations:  

x + y = 8         (1)

(x^2)y = 72     (2)

> eq1:=x+y=8;

eq1 := x+y = 8

> eq2:=(x^2)*y=72;

eq2 := x^2*y = 72

> sol:=fsolve({eq1,eq2},{x,y});

sol := {x = 6.000000000, y = 2.000000000}

2a. Substitute the solution in the equations to verify.

> subs(sol,eq1);

8.000000000 = 8

> subs(sol,eq2);

72.00000000 = 72

3. Plot implicit function:  (x^2)/25  +  (y^2)/9  =  1.

Note: First load the plots package.

> with(plots):

Warning, the name changecoords has been redefined

> implicitplot(x^2/25 +y^2/9=1 , x=-5..5, y=-5..5, scaling=constrained);

[Plot]

4. Evaluate an expression to n digits.

> g:=10^(1/3);

g := 10^(1/3)

> evalf(g,5);

2.1544

--
Dr. Sanjay Paul
January 2004


EC 309