Laboratory 7
Maxima, Minima, and the Derivative

Introduction

We have already learned that the derivative of a function at a point gives us the slope of the tangent line to the graph of that function at that point. We have also learned how to compute the derivative for various functions. In this lab, we continue our study of the derivative and shall investigate what other information we can get from the derivative of a function. In particular, we shall discover how we can use the derivative to identify the maximum and minimum values of functions.

7.1 Vertical Motion

Suppose that a projectile initially at height h above the ground is thrown directly upward with velocity (Subscript[v, 0]). Physics tells us that the height y(t) of the projectile above the ground as a function of the time t is given by the equation y(t)=h+(Subscript[v, 0])t-(1/2)g (t^2), where g is the gravitational constant. If we measure height in meters, time in seconds, and velocity in meters per second, then g≈9.8. 
	Our problem is to determine the maximum height above the ground reached by our projectile. Rather than trying to solve the general problem, let us start by considering an example. Suppose that we know that h=2 and (Subscript[v, 0])=5; substituting these values into our general form, we see that y(t)=2+5t-4.9(t^2). We can use Mathematica to plot the graph of y(t) and we can read the answer from the graph.

y[t_]:=2+5t-4.9t^2
Plot[y[t],{t,0,2},PlotRange->{0,4}]

From the graph, we can see that the maximum occurs approximately when t≈0.5, and that the maximum height is approximately y≈3.3. Notice that the graph is not the path that the projectile will take, but rather shows how the height of the projectile changes as time changes.
	Although this process works well, it has one downside, namely that we must already know the values of h and (Subscript[v, 0]). Without this information, we can not draw our graph, and consequently can not read off the maximum height. We also can not use this process to answer related questions, such as how does the maximum height obtained by the projectile depend upon the initial height and the initial velocity; or how much do we have to change the initial velocity to double the maximum height. 
	These questions can be answered with the aid of Calculus. To illustrate the process, we shall continue to study the case where h=2 and (Subscript[v, 0])=5. We know that we can compute the velocity of our projectile using the derivative; in fact the velocity is simply y'(t) which we have already learned how to calculate.
	If we then plot y(t) (in red) and y'(t) (in blue) on the same axes, we see that the projectile reaches it maximum height when the velocity y' is zero.

Plot[{y[t],y'[t]},{t,0,2}, PlotRange->{-2,5},PlotStyle->{{RGBColor[1,0,0]},{RGBColor[0,0,1]}}]

We can use the derivative to find out the exact time when the projectile reaches its maximum point; indeed this can be done using the Mathematica command Solve as follows.

Solve[y'[t]==0,t]

Then to find  the maximum height, we can substitute this time in to our expression for height, giving us

y[0.510204]

So that the maximum height is about 3.28.

Experiment  7.1

1) What is the maximum height achieved by a projectile thrown upward from height 6 and initial velocity 7? Make a plot showing the height and velocity.
2) What is the maximum height achieved by a projectile thrown upward from height 8 and initial velocity 3? Make a plot showing the height and velocity.

Review

In the last section we used our knowledge of the derivative to determine when a projectile reaches its maximum height. We would like to be able to use a similar process for more general functions. Before we can do so however, we must determine the relationships between the derivative of a function, and the maxima and minima of the function. As a first step in this process, we shall examine the relationships between the derivative and relative maxima and minima of a function.
	We start by reviewing some terminology. Consider a function y=f(x) defined in a neighborhood of a point c. We say that f has a relative maximum at the point c if f(c)≥f(x) for every point x in some open interval I containing the point c. Similarly, f has a relative minimum at the point c if f(c)≤f(x) for every point x in some interval I containing the point c.

7.2 Points where f'(x)=0.

Consider the function y(x)=sin(π x).

Clear[y,x];
y[x_]:=Sin[Pi x]

We can plot this function in red, and the derivative of this function in blue on the interval -2≤x≤2 with the command

Plot[{y[x],y'[x]},{x,-2,2},PlotStyle->{{RGBColor[1,0,0]},{RGBColor[0,0,1]}}]

Looking at the graphs, we see that the function has relative maxima or minima at the points -3/2, -1/2, 1/2, and 3/2. Further, we can also see that the derivative of the function is zero at the points -3/2, -1/2, 1/2, and 3/2. As a consequence, we see that every relative maximum or minimum occurs at a point where y'(x)=0, and that every point where y'(x)=0 is also either a maximum or a minimum.

7.3 Critical Points

We know that not every function is differentiable at every point in its domain. As an example, consider the function 
			y(x)=|sin x| 
To implement this function in Mathematica, we need to know how to define the absolute value of a function. Mathematica has a built in command for the absolute value of a number called Abs[x]. Unfortunately, the method that Mathematica uses to implement this function causes us some difficulty. For that reason we shall use the function Ab[x] defined below.

Ab[x_]:=Sqrt[x^2]

Now we can define our function y(x)=|sin x| as follows.

Clear[y,x];
y[x_]:= Ab[Sin[x]];

We can then plot this function and its derivative just as we did before, with the command

Plot[{y[x],y'[x]},{x,-2,2},PlotStyle->{{RGBColor[1,0,0]},{RGBColor[0,0,1]}}]

This function is not differentiable when x=0. We can see from the graph that y has a relative minimum when x=0, and that y' (0)  is not defined. Thus, it is possible for a function to have a maximum at a point where f'(x)≠0, provided we allow for the possibility that f'(x) does not even exist. For this reason, we say that points where either f'(z)=0 or points where f'(z) does not exist are called critical points for the function f.
	The following are the analogues of statements (1) and (2)  where the points at which the derivative vanishes are replaced by critical points, and we remove the restriction that f'(x) exists for every x.
	
	(1*) For any function y=f(x), if f has a relative maximum or a relative minimum at the point z, then z is a critical point for f .
	(2*) For any function y=f(x), if f has a critical point at z, then f has a relative maximum or relative minimum at the point z.

We would like to know which, if either of these statements are true.

Experiment  7.2

For each of the functions below, answer the following 4 questions.

	1) For each function, find all values of x where f has a critical point.
	2) For each function, find all x where f(x) is a relative maximum or a relative minimum.
	3) Does every relative maximum or relative minimum occur when at a critical point?
	4) Is every value of x where f has a critical point also at a relative maximum or relative minimum?
	
	Finally, after answering these four questions for all functions below, draw a conclusion about the veracity of statements (1*) and (2*) .		
	a) f(x)=(x^2)		 b) f(x)=(x^3)  
	
	c) f(x)=|x((|)^(2/ 3 ))       d) f(x)=(x^2)sin x

Credits

These laboratories were created by Raouf Boules, Geoff Goodson, Ohoe Kim and Mike O'Leary for use in the Calculus courses of Towson University. Commercial use is prohibited without permission of the authors. Non-commercial use is permitted, provided this credit section is retained.