Module 8 : Differential Calculus

804 : The Shapes Of Graphs

O B J E C T I V E

In this project we explore the connection between the first and second derivatives of a function and the shape of the functions graph. Exploring these concepts from both an algebraic and geometric point of view, we will see for how the values of the derivatives effect graphs and can be recognized from the graph.
Tools you'll need for this Project : Two colors of highlighting pens.

S E T U P

In this project we will use the following command packages. Type and execute this line before beginning the project below. If you re-enter the worksheet for this project, be sure to re-execute this statement before jumping to any point in the worksheet.

> restart; with(plots):

Warning, the name changecoords has been redefined

___________________________________________________________________________________

A. A Symbolic Approach

___________________________________________________________________________________

The derivatives of a function tell us a lot about the shape of its graph. The first derivative tells us where the graph is increasing or decreasing. When f'(x) > 0, the function is increasing, and where f'(x) < 0, the function is decreasing.

> f := x -> x^3 - x^2 - x + 4;

f := proc (x) options operator, arrow; x^3-x^2-x+4 ...

> Increasing := solve( D(f)(x) > 0 , {x});

Increasing := {x < -1/3}, {1 < x}

In a similar way, the second derivative gives us information about where a graph is concave up curvature or concave down curvature. A positive second derivative (f(x) > 0) indicates the curve is concave up at that value of x, and a negative second derivative indicates the curve is concave down at the value.

The set of values where f(x) is concave up

> Concave_up := solve((D@@2) (f) (x) > 0 , {x} );

Concave_up := {1/3 < x}

The solutions to these problems are intervals. Maple provides the answers in a different notation than we normally do in mathematics.Here are some example.

Maple Output {x < 5} , {9 < x} {2 < x , x < 3}

Set Notation {x : x < 5 or 9 < x} {x : 2 < x < 3 }

Interval Notation ( -inf, 5) U ( 9, inf) (2 , 3)

In some problems Maple gives us an answer which is correct but perhaps a bit complicated to get a handle on. We can force a decimal solution by using the evalf(% ) command immediately after the solution.

> f := x -> x^4 - 16*x^3 + 89*x^2 - 200*x + 140;

f := proc (x) options operator, arrow; x^4-16*x^3+8...

> Increasing := solve( D(f)(x) > 0 , {x}); evalf(%);

Increasing := {4-1/2*sqrt(14) < x, x < 4}, {4+1/2*s...

{2.129171306 < x, x < 4.}, {5.870828694 < x}

> Concave_up := solve((D@@2) (f) (x) > 0 , {x} ); evalf(%);

Concave_up := {x < 4-1/6*sqrt(42)}, {4+1/6*sqrt(42)...

{x < 2.919876550}, {5.080123450 < x}

___________________________________________________________________________________

B. Geometric Approach

___________________________________________________________________________________

Now, we will explore these same properties from a geometric point of view. The format for this section is a little different. first graph the following functions, and print the graphs.

> plot( x^3 - x^2 - x + 4, x = -1.6.. 2);

[Maple Plot]

> plot( x^6 - 5*x^4 - 12*x^3 - x^2 + 15*x + 18, x =-2..3 );

[Maple Plot]

> plot( x/ (x^2 + 1), x = -3..3 );

[Maple Plot]

> plot( (9 - x) / (1 + x^2) , x = -5..5 );

[Maple Plot]

Here is a large block of Maple program code which defines a special plotting function. If you are unable to download this from the Waterloo Maple website, you can type it in from scratch. This entire block of commands needs to be entered at a single Maple prompt. On Macintosh systems, use the return to key to create new lines without executing the commands. On Windows systems, use shift return to create new lines without executing. If it doesn't work, carefully check every line to make sure its entered precisely the same. Computers are not very forgiving.

> with(plots):
shape_plot := proc(f1,a,b)
local box,i,n,x1,x2,xmid,delta,y1,y2,A,B, m,M,slope, concav:
n:= 100; delta := (b-a)/n; x2 := a;
M := maximize( f(x), x = a..b); m := minimize(f(x),x = a..b);
for i from 1 to n do
x1 := evalf(x2); y1 := evalf( f(x1));
x2 := evalf(a + i*delta); y2 := evalf( f(x2)); xmid := x1 + delta/2;
slope := evalf( subs( x = xmid, diff( f1,x )));
concav := evalf( subs( x = xmid, diff( f1,x $ 2)));
if( slope > 0 )
then A[i]:=plot( f1, x = x1..x2, color = blue, thickness = 4 );
else A[i]:=plot( f1, x = x1..x2, color = red, thickness = 2 );
fi;
if( concav > 0 ) then
B[i]:=polygonplot([[x1,M],[x1,y1],[x2,y2],[x2,M]],
color=green,style=patchnogrid);
else
B[i]:=polygonplot( [[x1,m],[x1,y1],[x2,y2],[x2,m]],
color=sienna,style=patchnogrid);
fi;
od;
display({ seq( A[i],i=1..n ),seq( B[i],i=1..n ) } );
end:

The command above defined a special plot function. Lets use it now. this command uses three parameters : a function to plot and the left and right endpoints of the interval to plot.

> f := x -> x^3 - x^2 - x + 4; shape_plot( f(x), -1.6, 2);

f := proc (x) options operator, arrow; x^3-x^2-x+4 ...

[Maple Plot]

The differing colors and thickness of the graph indicate what properties each portion of the graph has.

Increasing Decreasing

Curve color and thickness Thick blue curve Thin red curve

Concave up Concave down

Color area shading Green shading upward Beige shading downward

Note that local maxima occur where the curve changes from blue to red, and local minima occur where the graph changes from red to blue. Inflection points occur where the shading changes from green to beige or vice-versa.

> f := x -> x^6 - 5*x^4 -12*x^3 - x^2 + 15*x + 18; shape_plot( f(x), -2, 3);

f := proc (x) options operator, arrow; x^6-5*x^4-12...

[Maple Plot]

> f := x -> x/(x^2+1); shape_plot( f(x), -3, 3);

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

[Maple Plot]

> f := x -> x^2 + 1/(x^2 + 1); shape_plot( f(x), -3, 3);

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

[Maple Plot]

>