DISP Mathematics (Scie 1500R)

MAPLE Lab. Tutorial 3 Differentiation and Curve Sketching Monday January 31.


I explained in the last tutorial that there is a difference between an expression like $x^3 - 4x^2 + 1$ and the function $f$ that assigns to each $x$ the expression $x^3 - 4x^2 + 1$. This difference is important in the MAPLE syntax for differentiation.

To differentiate expressions we use the command diff(expression, variable);. The result is another expression.

To differentiate functions we use the command D(function); and the result is another function.

The command implicitdiff(equation, variable1, variable2); will find the derivative of variable$1$ with respect to variable$2$ by implicit differentiation.

Test MAPLE's knowledge of the rules for differentiation by making up a variety of functions using combinations of sin, cos, tan, cosec, sec, cotan, exp, log, (or ln) sqrt and rational functions.

Try using BOTH expressions with diff and functions with D. Also, try finding second and higher derivatives.

Here is an example about implicit differentiation:

Example: Find tangent line to curve $\sin (x+y) = y^2\cos(x)$ at point $(\pi/2, \pi/2).$

> eqn := sin(x+y) = y$\,^{\wedge}$2*cos(x);

Verify given point lies on curve:

> subs({x=Pi/2,y=Pi/2},eqn);

> simplify(%);

Find $dy/dx$ (in terms of $x$ and $y$):

> y1 := implicitdiff(eqn,y,x);

Slope at given point:

> subs({x=Pi/2,y=Pi/2},y1);

> m := simplify(%);

Tangent line in point-slope form:

> line := y-Pi/2 = m*(x-Pi/2);

A plot:

> with(plots):

> implicitplot({eqn,line},x=0..Pi,y=0..Pi);



Before you start these exercises type restart.

1. Define the function $f: = x \mapsto x^4 - 3x^2 + 2x - 1$.

(In what follows it is assumed that you have $f$ as a function. The alternative commands for $f$ as an expression are given in brackets).

Now type the following commands:
> xint := fsolve(f=0);     ( > xint := fsolve(f=0,x);)
> yint := f(0);     ( > yint := subs(x=0,f);)

What do these values represent?

2. Find the derivative of $f$:
> f1 := D(f);     ( > f1 := diff(f,x);) and now type:
> crits := fsolve(f1=0);     ( > crits := fsolve(f1=0,x);)

What do these values represent?

3. Find the second derivative of $f$:
> f2 := D(f1); or > f2 := D(D(f); ( > f2 := diff(f1,x); or > f2 := diff(f,x$2); the $2 says do it twice)
Now use the second derivative test:
> f2(crits[1]);     ( > subs(x=crits[1],f2);)
> f2(crits[2]);     ( > subs(x=crits[2],f2);)
> f2(crits[3]);     ( > subs(x=crits[3],f2);)

Which of the critical points are relative maxima?minima?

3. We now find the inflection points:
> inflects:= fsolve(f2=0);     ( > inflects := fsolve(f2=0,x);)

How many inflection points are there?

4. We are now going to make a list (lists are made with square brackets [...]) of all the points we have calculated:
> xlist := [xint,0,crits,inflects]; (this is a list of $x$-coordinates).

Copy down this list (using ONE decimal place)

$,$ [OVER]

Next we make them into points in the plane (vectors also in square brackets):
> pts := map(a->[a,f(a)],xlist);     ( > pts := map(a->[a,subs(x=a,f)],xlist);)

and now we can plot these points (in a minute). The next 3 commands end with : NOT ;
> plot1 := plot(pts,style=point,symbol=circle,color=blue):
> plot2 := plot(f,-2.3..2,color=red): ( > plot2 := plot(f,x=-2.3..2,color=red):)

Now we call up the plotting routines:
> with(plots):

And finally we plot both the function AND the points:
> display({plot1,plot2});

Use the list of numbers you copied down above to answer the following questions:

Make a list of the intervals where $f$ is increasing,

Make a list of the intervals where $f$ is decreasing,

Make a list of the intervals where $f$ is concave up,

Make a list of the intervals where $f$ is concave down,

Tony Thompson