Topic 4 Application of Differentiation
4.1 Maximum and Minimum Values
If is continuous on a closed interval , then attains an absolute maximum value and an absolute minimum value at some numbers and in .
A critical value of a function is a number in its domain such that either or does not exist.
To find the absolute maximum and minimum values of over , we do the following.
- Find the values of at the critical values in .
- Find the values of and .
- The largest of the values from Steps 1 and 2 is the absolute maximum value; the smallest of these values is the absolute minimum value.
To find critical values, we solve the equation and look at where is undefined. In Maple, you can use the command CriticalPoints(function, variable)
which is supported by the subpackage Student[Calculus1]
.
Example 4.1 Find the absolute maximum and minimum values of the function over the interval .
Solution. First defined the function.
f:=x->abs(x^2-2*x-3)
Find critical points.
with(Student[Calculus1]):
Cpts:=CriticalPoints(f(x), x);
Let’s put endpoints and critical points in in a list.
lst:=[op(remove(c->c<0 or c>4, Cpts)),0,4];
# The op function extracts elements from the list.
# The remove function removes removes the elements of Cpts in [0,4]
# The remove function use a Boolean-valued procedure as a condition.
# A procedure can be considered as a function. This is why we use ->.
Evaluate the function at each point in the list.
fc:=f~(lst) # ~ is the element-wise operator.
Find the maximum and minimum.
fmax:=max(fc);
fmin:=min(fc);
You may use the following code to display at where the function reaches an extremum.
for c in lst do
if f(c) = fmax then print(The maximum value of f(x) over [0, 4] is*%f(c) = fmax);
elif f(c)=fmin then print(The minimum value of f(x) over [0, 4] is*%f(c) = fmin);
end if;
end do;
Remark.
The above solution is still the method using Calculus but with the assistant of Maple. Indeed, Maple has the commands maximize(f(x), x=a..b)
and minimize(f(x), x=a..b)
which produce the maximum and minimum of a function over an interval .
Exercise 4.1 Find the absolute maximum and minimum values of the function over the interval .
Exercise 4.2 Find the absolute maximum and minimum values of the function over the interval .
4.2 The Mean Value Theorem
Rolle’s Theorem states that if a function is continuous on the closed interval , differentiable on the open interval and , then there exists a point in such that .
Using Maple, you can verify this theorem for a function graphically using the following command
RollesTheorem(f(x), x = a..b)
which is supported by the subpackage .
Example 4.2 Let . Graph the function from to indicate the points between and where tangent line is horizontal. Find values in at where the tangent line is horizontal.
Solution. Define the function.
restart:
f:=x->(x-1)*(x+1)*(x-2)
Now let’s create the graph of the function and the horizontal tangent line.
with(Student[Calculus1]):
RollesTheorem((x-1)*(x+1)*(x-2), x = -1..2);

A demonstration of Rolle’s theorem
To find the values . We solve the equation .
solve({D(f)(x)=0, x>-1, x<2}, x)
A generalization of Rolle’s theorem is the Mean Value Theorem.
If a function is continuous on the closed interval and differentiable on the open interval , then there exists a point in such that or equivalently,
The subpackage Student[Calculus1]
also provides a command MeanValueTheorem(f(x), x = a..b)
to illustrate the Mean Value Theorem.
Example 4.3 Let . Graph the function from to indicate the points between and where tangent line is parallel to the secant line passing through and . Find the values where the tangent line is parallel to the secant line.
Solution. Define the function.
restart:
f:=x->(x-1)*(x+1)*(x-2)
Now let’s create the graph of the function and the horizontal tangent line.
with(Student[Calculus1]):
MeanValueTheorem(f(x), x = -2..3);

A demonstration of Mean Value Theorem
Find the slope msec
of the secan line.
a:= -2;
b:= 3;
msec:=(f(a)-f(b))/(a-b);
Solve the equation msec
for .
solve({D(f)(x)=msec, x>-2, x<3}, x)
Note that in Rolle’s theorem and Mean Value Theorem, the continuity and differentiability conditions are crucial.
Example 4.4 Consider the floor function . Use a graph to show that there is no tangent line that is parallel to the secant line through and .
Solution. First define the function.
restart:
f := x->piecewise(x<0, 1, 2);
Now let’s find the second line.
a := -1; # left endpoint
b := 1; # right endpoint
msec:=(f(b)-f(a))/( b-a ); # slope of secant line
secline:=f(a) + msec*(x-a); # secant line
Plot the function and the secant line together.
plot([f(x), secline], x=a..b, discont=true);
Now try the MeanValueTheorem
command.
with( Student[Calculus1] ):
MeanValueTheorem( f(x), a..b );
Exercise 4.3 Let . Graph the function from to and indicate the points in where the derivative is . Find the tangent points where the slope of the tangent line is .
Exercise 4.4 Let . Graph the function from to indicate the points between and where tangent line is parallel to the secant line passing through and . Find the tangent points where the tangent line is parallel to the secant line.
Exercise 4.5 Consider the floor function . Use a graph to show that there is no tangent line that is parallel to the secant line through and .
4.3 Derivatives and the Shape of a Graph
Given a function , we know that is increasing on an interval if on that interval and is decreasing on an interval if on that interval. By Mean Value theorem, is a constant on an interval if on that interval.
To determine over which interval a function is increasing/decreasing, we need to find out the domain of and the critical points and then use test points to determine the sign of .
Using first derivative, we can test local extrema at critical points.
Theorem 4.1 Suppose that is a critical point of a continuous function .
- If changes from positive to negative at , then has a local maximum at .
- If changes from negative to positive at , then has a local minimum at .
- If does not change signs at , then has no local extremum at .
Another method to determine local extremum is to use second derivative.
Theorem 4.2 Suppose is a twice differentiable function on an interval .
- If over , then is concave upward on .
- If over , then is concave downward on .
Base on the observation on concavity, we have the following second derivative test.
Theorem 4.3 Suppose that is continuous near .
- If and , then has a local minimum at .
- If and , then has a local maximum at .
Example 4.5 Find local extrema, the intervals on which is increasing or decreasing and the intervals on which is concave up or concave down.
Solution. First we define the function and find the derivatives. f:=x->x/(x^2+1); df:=D(f); ddf:=D(D(f));
Now let’s find critical points using Student[Calculus1]
subpackage.
with(Student[Calculus1]):
CriticalPoints(f(x),x)
Find the intervals of monotonicity (using test points).
df(t) # where t is a test point in an interval, you replace it by a number.
Determine local extrema and find values.
g(c) # suppose c is a critical point.
Find critical points of the derivative function and determine intervals of concavity.
CriticalPoints(df(x),x);
ddf(t); # evaluate the second derivative at a test point $t$.
From the outputs, we know that is decreasing on and increasing on . It has a local minimum and a local maximum .
The function is concave cup on and concave down on .
Exercise 4.6 Let be a function defined over the interval . Find local extrema, the intervals on which is increasing or decreasing and the intervals on which is concave up or concave down.
4.4 Limits at Infinity and Asymptotes
Limits at infinity can provide information on the end behaviors of a curve such as horizontal and vertical asymptotes.
When the limit of a function is an infinite limits, we will get a vertical asymptotes.
The function has a horizontal asymptote if or .
The function has a horizontal asymptote if , , or .
The function has a slant asymptote if or .
For rational functions, we have the following results. Suppose and In the last case, the sign agrees with the sign of .
The limit at the negative infinity of a rational function is similar.
In Maple, to find limits, we use the command limit(f(x), x=a)
or LimitTutor(f(x), x=a)
supported by Student[Calculus1]
. To find asymptotes, you may use the command Asymptotes(f(x), x)
which is again supported by Student[Calculus1]
.
Example 4.6 Evaluate the following limits.
- ,
- .
Solution.
Use LimitTutor
to find limits step-by-step
with(Student[Calculus1]);
LimitTutor(sqrt(x^2+1), x=infinity);
LimitTutor((x^3-1)/(9*x^6-x), x=-infinity);
LimitTutor(x*sin(1/x), x=infinity);
Example 4.7 Find asymptote of the function and plot the graph of and its asymptotes together with in and in .
Solution. Define the function first.
restart:
f:=x-> (x^3+2*x^3-3*x-1)/(x^2-1);
Find and plot asymptotes. Here, it’s better to use implicitplot
because vertical asymptotes are not functions of .
with(Student[Calculus1]):
asym := Asymptotes(f(x), x);
with(plots):
asymplots := implicitplot(asym, x = -5 .. 5, y = -10 .. 10):
Plot the function and use display
to put the graph and asymptotes together.
Grphf:=plot(f(x), x=-5..5, y=-10..10, discont=true):
display(asymplots, Grphf); # display is supported by the plots package.

A graphs of rational functions with its asymptotes
Exercise 4.7 Evaluate the following limits.
- ,
- .
Exercise 4.8 Find asymptote of the function and plot the graph of and its asymptotes together with in and in .
Exercise 4.9 Find asymptote of the function and plot the graph of and its asymptotes together with in and in .
4.5 Curve Sketching
To plot the graph of a function in maple, we simply use the command plot(function, widows, options)
.
On the other hand, we can sketch the graph using calculus, more precisely, monotonicity, concavity, vertical asymptotes, horizontal asymptotes, periods, symmetries, local extrema, intercepts etc.
Example 4.8 Sketch and plot the graph of the function .
Solution. First define the function
g:=x->(2*x+1)/(x-2)
Find the domain of the function.
solve((x-2)!=0, x)
Find the -intercepts.
solve(g(x)=0, x)
Find the -intercept
g(0)
Check whether , where the function is undefined, is a vertical asymptote.
limit(g(x), x=2, left);
limit(g(x), x=2, right);
Find horizontal asymptotes
limit(g(x), x=infinity);
limit(g(x), x=-infinity);
Then we find derivative functions.
dg:=D(g); # first derivative
ddg:=D(dg); # second derivative
Find all critical points. This can be done by finding using the Student[Calculus1]
subpackage.
with(Student[Calculus1]):
CriticalPoints(g(x),x);
Find the intervals of monotonicity (using test points).
dg(t) # where t is a test point in an interval, you replace it by a number.
Determine local extrema and find values.
g(c) # suppose c is a critical point.
Find critical points of the derivative function and determine intervals of concavity.
CriticalPoints(dg(x),x);
ddg(t); # evaluate the second derivative at a test point $t$.
Sketch the graph using above obtained information and compare with Maple plot
output.
plot(g(x), x=a..b) # Plot the function in the window [a, b].
Exercise 4.10 Sketch and plot the graph of the function .
Exercise 4.11 Sketch and plot the graph of the function .
4.6 Optimization Problems
To solve a optimization problem in Calculus, the key is to represent the quantity to be optimized by a function of other quantities and then find the extremum value using the extreme value theorem.
Example 4.9 Among rectangles with the same perimeter centimeters, there is one that has the largest area. Find the dimension of that rectangle.
Solution. Suppose the length is and the width is . The area is a function of and .
A:=(x, y)->x*y;
We know that the perimeter is which provides a relation between and .
prm:=2x+2y=16;
Solve for and plug it in to the area function.
wd:=solve(prm, y);
y:=unapply(wd, x); # define y as a function of x
Ar:=unapply(A(x,y(x)),x); # Translate the area function into a function of x.
To find the maximum area, you may use maximize
or using the following commands. Note that .
Amx := max(Ar~(solve(D(Ar)(x) = 0, x))); # Find critical points, evaluate, and find the maximum.
xvalue := solve(Ar(x) = Amx, x); # Find the length x such that the area is the largest.
yvalue := y(xvalue); # Find the width y such that the area is the largest.
Exercise 4.12 Find the rectangle with the minimal perimeter among rectangles with the area 36 square inches.
Exercise 4.13 Find the point on the parabola that is closest to the point .
4.7 Antiderivatives
An antiderivative of a function over an interval is any function such that for all in .
Antiderivatives are closely related to integration. In Maple, you may use int(f(x), x)
or IntTutor(f(x), x)
supported by Student[Calculus1]
to find an antiderivative of .
Example 4.10
Find an antiderivative of the function by hand and by Maple respectively. Use diff
to check your answer.
Solution. To find an antiderivative by hand, rewrite the function using negative rational exponent and apply the formula
In this question, an antiderivative is .
Define the function first.
restart:
f:=x->x^3-1/sqrt(x);
Find an antiderivative using int
and using IntTutor
for a step-by-step solution.
F:=int(f(x), x); # may define a function using unapply(int(f(x), x), x).
with(Student[Calculus1]):
TutorF:=IntTutor(f(x), x);
Verify using diff
.
diff(F, x);
diff(TutorF, x);
Exercise 4.14
Find an antiderivative of the function by hand and by Maple respectively. Use diff
to check your answer.
Exercise 4.15
Find an antiderivative of the function by hand and by Maple respectively. Use diff
to check your answer.
Exercise 4.16
Find the most general antiderivative of the function by hand and by Maple respectively. Use diff
to check your answer.