Section 2. Symbolics: Equations and Assignments
Solving equations is the bread and butter of mathematics. Maple does it in a natural way. It is always a good idea to assign a name to the equation and the solution.
0. Pull down the Help menu, choose New Users/Full Tour, then click on the third item: Algebraic Calculations and work through the examples in that worksheet.
Open a new Maple worksheet and do the following.
1. Make the following entry.
restart; x := y - z; y = 3: z := 4;
Then enter x and explain the output.
2. Make the following entry.
restart; x := y - z; y := 3: z = 4;
Then enter x and explain the output.
3. Make the following entry
restart; x := y - z; y := 3: z := 4;
Then enter x and explain the output.
Now enter the following
restart; x := z: z := y - w: w := 5:
Write on a pad of paper what you think Maple has stored for x, y, z, and w. Then predict the output for the entry
x + z;
Execute this entry to check your guess. Then do a restart by clicking on the restart button on the button bar (just to the right of the bug).
4. Enter the equation
with the name eqn.
Solve the equation and name the solutions solns with the entry
solns := solve( eqn, {x});
Check the third solution with the entry
eval( eqn, solns[3]);
Explain why the output confirms the validity of the solution.
Check all three solutions with the entry
eval(eqn,solns[k]) $ k=1..3;
Read the error message carefully and fix the problem (premature evaluation) by enclosing the eval procedure in single quotes to delay evaluation as shown below . Do not retype the entry, just add the single quotes and press the [return] key.
'eval(eqn,solns[k])' $ k=1..3;
5. Use fsolve to obtain an approximate real solution to the equation
Name the solution soln.
Hint. Name the equation eqn and simply enter soln := fsolve(eqn,{x}).
Check the approximate solution using eval(eqn,soln).
6.* Plot the expression
with the entry
y := x^3 - x^2 + 0.05*x + cos(x) - 0.7; plot( y, x=-2..2, -2..2);
Enter fsolve(y=0,x) to see which zero fsolve finds.
Using the graph as a guide, obtain an approximation to the largest positive zero using fsolve(y=0,{x},a..b).
7. Find the first three positive solutions to the equation
Hint. Define the function y = cos(x) - x tan(x) with the entry
y := cos(x) - x*tan(x);
Plot y using appropriate domain and range values (and discont=true), then use fsolve with specific interval settings obtained from the graph.
8. Let y be the function of x defined in Exercise 7. Enter
solve(y=0,{x}); evalf(%);
and comment on the output.
9. Graph the function
over the interval from x = 0 to x = 2. Define yp as its derivative and find the zero of yp near x = 1.5. Name it xmin. Then find the minimum value of y over this interval using eval(y,x=xmin). Name it ymin.
Use the following entry to plot the graph and the low point.
plot( [y, [ [xmin,ymin] ] ], x=0..2, style=[line,point]);
10.* Find the area of the region between the graph in Exercise 9 and the x-axis.
Hint: Numerically integrate the absolute value of y from x = 0 to x = 2 via the entry
evalf( Int( abs(y), x=0..2) );