Derivatives problem 07.mws

1. Maple and the quotient rule.

Let us consider the functions defined below.

> f:=x->x^2-x+1;

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

> g:=x-> x^2+3*x-2;

g := proc (x) options operator, arrow; x^2+3*x-2 en...

To multiply the two functions together in Maple, you simply multiply the symbols naming the function. You can even give the product a name, as below, and this becomes a new function.

> h:=f*g;

h := f*g

> (f*g)(x);


> h(x);


It is easy to calculate the derivative of the product of two functions in Maple.

> D(f*g);D(h);

proc (x) options operator, arrow; 1/2*1/sqrt(x-1) e...

proc (x) options operator, arrow; 1/2*1/sqrt(x-1) e...

However, it is not at all obvious what Maple means by the expression above. One can try evaluating at the point x.

> D(f*g)(x);


Notice that Maple has not simplified the product, but just did the product rule the same way you would do it by hand. We can simplify the answer as well.

If we ask Maple to simplify D(f*g) Maple does not do anything helpful.

> simplify(D(f*g));

proc (x) options operator, arrow; 1/2*1/sqrt(x-1) e...

But if we simplify D(f*g)(x) , we get somewhere.

> simplify(D(f*g)(x));


Now let us investigate the quotient rule.

> f/g;


> (f/g)(x);


> D(f/g)(x);


Now wait a minute, that does not look like the quotient rule. Maple does not use the quotient rule the same way that we learn it in a Calculus class. In fact, Maple uses the following rule. D(1/g)(x) = -D(g)(x)/(g(x)^2) . Then to find the derivative of a quotient, it applies the product rule. Thus we obtain the quotient rule in the form D(f/g)(x) = D(f)(x)/g(x)-f*D(g)/(g(x)^2) . Can you recognize this formula in the example above?  Of course, we can still simplify the result above to get a nice form for the result.

> simplify(D(f/g)(x));



Use Maple to compute the derivative of the function given by f(x) = 4*x/(x^2+1) , whose graph is called Newton's Serpentine . Use Maple to compute and simplify the derivative, and plot both the function and its derivative on the same graph. Then write an explanation of why the graph of the derivative seems reasonable for the function, by pointing out key features of the graph of the function that are reflected in the graph of its derivative.

Submission worksheet:


2. Approximating the derivative by difference quotients.

By the definition of the derivative in terms of a difference quotient, we know that cos(x) = limit((sin(x+h)-sin(x))/h,h = 0) .  To investigate this, let us define the difference quotient as a function of two variables as follows:

> h:='h';

h := 'h'

> dq:=(x,h)->(sin(x+h)-sin(x))/h;

dq := proc (x, h) options operator, arrow; (sin(x+h...

> dq(x,h);


Let us plot the function and its difference quotients for various values of h on the same plot.

> plot([cos(x),dq(x,1),dq(x,.5),dq(x,.1)],x,color=[blue,pink,green,red]);

[Maple Plot]

It is hard to distinguish the graph for h=0.1 and the original graph. You might try changing the y scale to see if you can get an image which is separated more.


The centered difference quotient is given by  (f(x+h)-f(x-h))/(2*h)

(a) Repeat the process above using the centered difference quotient instead of the difference quotient.

(b) Now consider the function y = cos(x) .

We know that dy/dx = -sin(x) . Repeat the process outlined above, first using the difference quotient and then using the centered difference quotient. Plot your graphs over the interval [ -Pi, 2*Pi ]. Then to get a better view, narrow the interval for your graphs.

Submission worksheet: