A GUIDE TO MAPLE
LESSON 1
1. Define an expression: 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); |
| > | f11:=diff(f1,x); |
1b. Plot the function. Specify ranges for x and z.
| > | plot(f, x=0..10, z=-20..100); |
![[Plot]](images/guide1_4.gif)
1c. Substitute a value for x in the function.
| > | subs(x=4,f); |
2. Solve two equations:
x + y = 8 (1)
(x^2)y = 72 (2)
| > | eq1:=x+y=8; |
| > | eq2:=(x^2)*y=72; |
| > | sol:=fsolve({eq1,eq2},{x,y}); |
2a. Substitute the solution in the equations to verify.
| > | subs(sol,eq1); |
| > | subs(sol,eq2); |
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]](images/guide1_11.gif)
4. Evaluate an expression to n digits.
| > | g:=10^(1/3); |
| > | evalf(g,5); |
--
Dr. Sanjay Paul
January 2004