Differentiating Using Maple

The most basic concepts of calculus are the derivative and the integral. It should come as not surprise that Maple has utililities to symbolically compute both. In this section we consider the derivative. The basic command is

>diff(expression, variable);

Consider the examples.




Explain this one.



Functions can also be used. For example, we might have




We can also find the second derivative. Here is the command



Higher order derivatives are just as easy to compute using the following general command


Here, $k$ is the order of the derivative to be determined. The similar command works for whole expressions: diff(expression,x$k); You need not use a function; any expression will do. This sometimes makes computations quicker and easier.

Finding relative maxima and minima

Maple is a power tool for finding relative maxima or minima. To accomplish this we need to used a couple of the commands already learned. There are two basic steps. (1) Find the derivative. (2) Find the critical points. (i.e. Solve MATH (3) Determine whether they are relative maxima or minima. (i.e. Evaluate MATH at the critical points.) Confirm the results using the plot function. Here is a complete example.


Find the relative maxima and minima for the function MATH

> f:=x->x^3+6*x^2+1;


> diff(f(x),x);


> solve(%,x);

0, -4

> subs(x=0,diff(f(x),x$2));subs(x=-4,diff(f(x),x$2));



We conclude that $f\left( x\right) $ has a relative maximum at $x=-4$ and a relative minimum at $x=0$. Now plot to confirm what has been proved.



Note that the the range of the plot was suitably restricted so as to reveal a ``good'' picture of the function within the range in question.

Alternative Forms for derivatives

You can also differentiate using the
command. In addition, you can use this ``operator'' in composite form to find higher order derivatives as well. Thus MATH will yield the second derivative.Here is how.


This command will work only for functions as functions ``know'' what the variable is.

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

Find the first two derivatives as follows:

> D(f) $;$D(D(f)) $;$

As you can see D(f)yields a function. So, you can use it directly for critical points using fsolve. We obtain

> fsolve(D(f));

Below is an example using these and a couple of other features of Maple.


Find the relative and absolute maxima and minima and points of inflection for MATH of the function MATH

Solution. Convert the function to Maple syntax and proceed as above.

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

> D(f);

> crit_values:=fsolve(D(f));

$crit\_values$ MATH

Note in the next step that we index the variable $crit\_values.$ In this way we can reference the one we want. (Use square $\left[ {}\right] $ brackets to enclose the index.) We obtain

> f(crit_values\lbrack1\rbrack);f(crit_values\lbrack2\rbrack);



To apply the second derivative test, we need MATH. From above we use the command.

> D(D(f));

>D(D(f))(crit_values\lbrack1\rbrack);D(D(f))(crit_values\lbrack 2\rbrack);



> fsolve(D(D(f)));


Finally check the endpoints.

> f(-3);f(2);


We conclude that $f(-3)=-80.0$ is an absolute minimum; MATH is an absolute maximum, and MATH is a relative minimum.

Candidate for inflection points are the values just above. We need only check that MATH changes sign at these values --- and it does. Now plot the function in the interval MATH. The appropriate command is

> plot(f(x),x=-3..2);


  1. Find the relative maxima and minima for the following functions. Plot the function to confirm your answers.

    1. MATH

    2. MATH

    3. MATH

  2. Find the relative and absolute maxima and minima and points of inflection for the given function over the given interval

    1. MATH for MATH

    2. MATH for MATH

    3. MATH for MATH

    4. MATH for MATH

  3. Find the derivatives of the following functions as indicated.

    1. MATH Find MATH

    2. MATH Find MATH


Don't forget those semicolons (;).

  1. MATH

This document created by Scientific Notebook 4.0.