next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

Subsections


Differentiation

D and diff

Maple knows how to take many derivatives. Its main commands for doing this are D and diff. D is designed to differentiate functions, whereas diff is for differentiating expressions. However, if proper notation is used, diff can also be used with functions. To review the difference between a function and an expression, check the two examples below. The f statement defines a function, the g statement defines an expression.

  > f:=x->x^2+7*x+5;
  > g:=x^3-5*x+8;
Here are some examples that show how D and diff work. Check the difference between these two commands.
  > D(sin);
  > D(sin)(x);
Also, check these two.
  > D(f);
  > D(f)(x);
Carefully consider these.
  > diff(g,x);
  > diff(f(x),x);
See what happens with these.
  > diff(g(x),x);
  > diff(f,x);
After the last four examples, you should be convinced that proper notation is very important in doing derivatives in Maple.

Maple can also do higher derivatives. Check these commands.

  > diff(g,x2);
  > diff(f(x),x$2);
The $ sign is used to indicate repeated differentiation, the number following it tells how many times the function or expression is to be differentiated. D will also do repeated differentiation.
  > (D@@2)(f)(x);


Just as Maple can plot several functions with a single command, it can differentiate more than one function at a time.
  > diff({sin(x)^2,sin(x^2)},x);
However, note that while Maple does what is asked, it rearranges the order of the output. So, be careful.

More information on diff and D can be obtained through Maple help screens.

Composition

Maple can be used to perform composition of functions (Note: functions, not expressions). The symbol for composition is @. Try these commands
  > (f@f)(x);
  > simplify(");
  > h:=x->x^3+x^2-3*x+4;
  > p:=x->8*x+6;
  > (f@h@p)(x);
  > simplify(");
  > (p@h@f)(x);
  > simplify(");
Are $f \circ h \circ p$ and $p \circ h \circ f$ the same?

Implicit Differentiation

The implicitdiff command can be used to find derivatives of implicitly defined functions. The syntax is as follows

  > implicitdiff(f,y,x);
where f is an expression or equation, y is the dependent variable and x is the independent variable. Thus the command as just stated would compute $\displaystyle\frac{dy}{dx}$. If f is given as an expression Maple will assume that the implicit equation is f = 0. Check the results of the following commands.
  > f:=x^2*y^2+y^3;
  > implicitdiff(f,y,x);
  > g:=x^2+y^3=1;
  > implicitdiff(g,y,x);
Second derivatives can also be taken with implicitdiff. The following command computes $\displaystyle\frac{d^2y}{dx^2}$.
  > implicitdiff(g,y,x,x);
Maple also has a command for plotting implicitly defined functions. It is in the package plots which must be called before using the command.
  > with(plots);
  > implicitplot(x^2-y^2=1,x=-3..3,y=-3..3);

Exercises

1.
Type and execute all commands given in the discussions above.
2.
A point (x0, f(x0)) on the graph of y = f(x) is known as a local minimum (maximum) point if $f(x_0) \leq f(x)(f(x_0) \geq
f(x))$ for all x in some open interval containing x0.
(a)
Plot $f(x) =
\displaystyle\frac{x(x-1)(x+3)}{(x+1)^2(x-2)(x-4)}$. What appears to be true about the slope of the tangent line at each local minimum or maximum point?
(b)
Use the observation you have just made to find the x-coordinate of each local minimum or maximum point. Note that the numer command could be helpful here.

3.
Find the point on the graph of $y = x^2\tan(x)$ that is closest to the point (2.1, 0.8).

4.
Consider the function $y = \sin^3(\cos(x^2+7x+1))$.
(a)
In order to take the derivative of the given function by the Chain Rule, it is necessary to describe the function as the composite of several functions. Prepare for applying the Chain Rule by finding appropriate functions $f(x), g(x), \ldots, t(x)$ such that $(t \circ
\cdots \circ g \circ f)(x)$ is the given function. Use Maple to show that your breakdown is correct.
(b)
Attach a handwritten page showing how the derivative is taken by means of the Chain Rule.

(c)
Use Maple to check your answer in (b).

5.
Consider a function y implicitly defined by the equation y4 - 2x2y2 + x3 = 17.
(a)
Attach a handwritten page on which you find $\displaystyle\frac{dy}{dx}$.
(b)
Use Maple to check your answer in (a).

(c)
Find an equation of the line tangent to the graph at the point (2,3).

next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

Christine Marie Bonini
12/1/1998