Derivatives problem 06.mws

1. The Chain Rule in context...change of units.

a) The chain rule is arguably the most important of the differentiation rules. It enables us to relate rates of change between two quantities to rates of change between two other, related quantities. For example, we all know from our understanding of motion, that feet, miles, hours and seconds are all related. Further, if you knew your speed in miles/hour you would be able to convert that speed into feet per second (or unit of distance per unit of time) .

Submission a):

If you are traveling at 60 mph, then what is your speed in feet per second? Why does your answer seem reasonable?

Submission worksheet:

 

b) Consider the function given by feet(sec) = sec^2-6*sec+9 which gives the position of a particle in feet as a function of the number of seconds that have elapsed. We want you to pay close attention to units here, so we will represent the derivative of this function by a name which describes it fully, namelyfeetpersecond(sec) = 2*sec-6 .  Suppose that we consider this particular particle's position over the time interval 0 <= sec and sec <= 30 , and sketch the graphs of feet and feet-per-second below:

> plot(t^2-6*t+9,t=0..30,xtickmarks = [5,10,15,20,25,30],labels=[`seconds`,`feet`],title=`Position Graph`);

[Maple Plot]

> plot(2*t-6,t=0..30,xtickmarks = [5,10,15,20,25,30],labels=[`seconds`,`feet per second`],title = `Velocity Graph`);

[Maple Plot]

Submission b):

Construct:

  1. A function that will give the position of the particle in yards as a function of seconds, so this should begin by looking like yards(sec) = ... and

  2. another function which gives the velocity of the particle in yards per second as a function of seconds. Sketch the graph of each of your functions over the domain 0 <= sec and sec <= 30 and comment particularly on how the ranges of your functions compare to those above. Why do they seem reasonable?

Submission worksheet:

 

c) Now we wish to obtain the position of the particle in feet as a function of minutes .

Submission c):

Construct:

  1. A function that will give the position of the particle in feet as a function of minutes, so this should begin by looking like feet(min) = ... and

  2. another function which gives the velocity of the particle in feet per minute as a function of minutes.

Suppose we only see this particle's position for 30 seconds before it vanishes from sight. Plot both your functions in 1 and 2 over an appropriate domain, and comment particularly on the ranges of the functions. Why do they seem reasonable?

Submission worksheet:

 

d) Clearly, seconds and minutes are related.

Submission d):

A function that will give seconds as an output, for minutes as an input. Find the derivative of this function with respect to minutes. Now suppose we wish to obtain the velocity of the particle in feet per minute at time 15 seconds. Answer this question in two ways. One - look up the appropriate point on a graph you constructed in part c). Two - multiply the point corresponding to time = 15 seconds on the graph of feetpersecond shown in part a) by the derivative (with respect to minutes) of the function that you found in part d). Why do these two approaches give the same value?

Submission worksheet:

 

2. Composition of functions and the chain rule in Maple.

In order to apply the chain rule, the first step is to decompose a function that you want to differentiate into a composition of two simpler functions. For example, consider the function F(x) = sqrt(x^2+1) . Let us define it in Maple.

> F:=x->sqrt(x^2+1);

F := proc (x) options operator, arrow; sqrt(x^2+1) ...

Of course, Maple can differentiate this function directly, but the point of this exercise is to see how to use the chain rule.  Let us define the functions f and g by

> f:=x->sqrt(x);g:=x->x^2+1;

f := sqrt

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

Maple uses the @ symbol for composition, because the usual small circle is not one of the keyboard symbols. Let us check that F = `@`(f,g) , by evaluating each of these functions at x .

F = `@`(sqrt,g)

> F(x);(f@g)(x);

sqrt(cos^2+1)

sqrt(cos^2+1)

What would happen if you typed in f@g(x) instead of (f@g)(x)? ( Moral : use parentheses around the f@g.)

Now let us calculate the derivative of F, by applying the chain rule, which in the language using D for the derivative operator is the statement  D(`@`(f,g))(x) = D(f)(g(x))*D(g)(x) .

Look carefully at the expression above to see exactly where the parentheses are placed. Note that D(f) is evaluated at g(x) , and D(g) is evaluated at x. Let us compute the left hand and the right hand sides of the expression above to see if they are the same.

> D(f@g)(x);

1/(cos^2+1)^(1/2)*cos

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

1/(cos^2+1)^(1/2)*cos

We have verified the chain rule using Maple for this particular pair of composed functions.

Submission:

For the following problems, follow the above scheme and first write the function as a composition of two functions that you define in Maple, and then compute the derivative in the two different ways:

Verify that you get the same answer.

(a) y = cos(x)^3

(b) f(x) = (1+cos(x)^2)^6

(c) f(x) = sin(1/x)

Submission worksheet:

 

3. The chain rule and the graph of the derivative.

Let f(x) = sqrt(1-x^2)/x .

Submission:

(a) Find f'(x) . Show your calculation of the derivative of the function by hand, using the chain rule, and other rules of differentiation such as the quotient rule, as well as a calculation of the derivative using Maple. You may have to simplify to compare your answer to Maple's answer, but be sure to show that the two answers agree.

(b) Graph the function and its derivative on the same plot, and compare the graph of the function to its derivative as you did in activity 1.

Submission worksheet:

 

4. The chain rule and parametric equations.

Suppose that x and y are given as parametric equations in the variable t . To plot the curve which is determined by these parametric equations, we can use a parametric form for the plot command in Maple. For example, if x = cos(t) and y = sin(t) , then one can plot the curve so defined by the command

> plot([cos(t),sin(t),t=-Pi..Pi],scaling=constrained);

[Maple Plot]

Notice that the curve parameterizes the unit circle, and it does not determine y as a function of x over the whole domain, because there are clearly two values of y corresponding to x = 0 , as well as a lot of other values of x . However, except when x = 1 and x = -1 , at any point on the curve there is clearly a non-vertical tangent line to the curve, and its slope is given by dy/dx , if we express y as a function of x in some small interval. We can compute this slope by the formula  dy/dx = D(y)(t)/D(x)(t) if we express x and y as functions of t. Let us do this at the point (x(Pi/4), y(Pi/4)) = (sqrt(2)/2, sqrt(2)/2) .

> x:=t->cos(t);y:=t->sin(t);

x := cos

y := sin

> D(y)(Pi/4)/D(x)(Pi/4);

-1

Thus the tangent line has slope -1, and goes through the point ( sqrt(2)/2, sqrt(2)/2 ). In order to plot the tangent line on the same axes as the original curve, we need to use the following property of parametric curves: If a curve is given parametrically in the form ( x(t), y(t) ), then its tangent line at ( x(a), y(a) ) is given parametrically by the curve ( D(x)(a)*(t-a)+x(a), D(y)(a)*(t-a)+y(a) ).  Using this fact, we can easily plot the curve and its tangent line at ( sqrt(2)/2, sqrt(2)/2 ).

> a:=Pi/4;

a := 1/4*Pi

> plot({[D(x)(a)*(t-a)+x(a),D(y)(a)*(t-a)+y(a),t=-2..3],[x(t),y(t),t=-Pi..Pi]},scaling=constrained);

[Maple Plot]

On page 191 of the text, a parametric formula for d^2*y/(dx^2) is given. In order to compute this derivative, it is first necessary to find dy/dx as a function of t , and then to differentiate this function with respect to t . Let us do this using Maple.  First we find dy/dx as in terms of t

> D(y)(t)/D(x)(t);

-cos(t)/sin(t)

Next, we define a function which defines dy/dx as a function of t .

> yprime:=t->-cos(t)/sin(t);

yprime := proc (t) options operator, arrow; -cos(t)...

This function can be differentiated like any other function of t.

> D(yprime)(t);

1+cos(t)^2/sin(t)^2

Finally, we use the parametric formula from page 191 to express the second derivative d^2*y/(dx^2) in parametric form.

> D(yprime)(t)/D(x)(t);

-(1+cos(t)^2/sin(t)^2)/sin(t)

> simplify(%);

1/(sin(t)*(-1+cos(t)^2))

Maple did not simplify this expression in quite the same form that we would. In fact, Maple often expresses the derivatives of trigonometric functions in a different way than we would do if we calculated the answer by hand. Another way to calculate the derivative is using the formula d^2*y/(dx^2) = (`@@`(D,2)(y)(t)*D(x)(t)-D(y)(t)*`@@... .  Let us apply this formula to our functions.

> ((D@@2)(y)(t)*D(x)(t)-D(y)(t)*(D@@2)(x)(t))/(D(x)(t)^3);

-(sin(t)^2+cos(t)^2)/sin(t)^3

> simplify(%);

1/(sin(t)*(-1+cos(t)^2))

Notice that Maple simplifies it in the same way as before. But if we were going to simplify the expression, we would get a much simpler expression for the derivative. What is that much simpler expression?

Submission:

For the parameterized curve ( x = e^t*cos(t), y = e^t*sin(t) ) , with t in [ 0, Pi ] :

(a) Plot the curve for the given interval of t values.

(b) Find dy/dx and d^2*y/(dx^2) at the point Pi/2 .

(c) Find an equation for the tangent line to the curve at the point defined by t[0] = Pi/2 Plot the curve together with the tangent line on a single graph.

Submission worksheet:

 

5. More context for the Chain Rule.

a) In 1989, based on some theoretical analysis, a mathematical biologist named Murray determined that the velocity in miles per year of the spread of the Black Death in Europe from 1347 through 1350 was given approximately by a certain function of the population density, measured in number of people per square mile, namely

MilesPerYear = 200*sqrt(.8e-2*density-15) , provided density > 1875 and 0 otherwise.

So to figure out MilesPerYear when the population density is 1880 people per square mile, you plug the population density of 1880 into the right-hand side.

The units of the derivative of this function are at first strange: (Miles per Year) per (person per square mile).

Submission a):

If the density is decreasing as a function of time because people are dying or leaving, the spread of the plague should be slowing because people are not packed so closely together, and so it is more difficult for fleas to jump from one person to the next. We should be able to see this "mathematically" from the chain rule. Explain how we can see this. Remember: you need to think of density as a function of time. HINT: Think about the derivative of density.

Submission worksheet:

 

b) What often happened during the plague is that when summer came, some people left in droves from population centers, and went to the countryside. Sometimes city officials would actually close the city gates to ebb the flight. In fact during a big plague a few centuries later, Newton left for the countryside, was hit on the head by an apple, and invented calculus. So let's suppose that in a certain town and on a certain fortnight (fourteen days) in the early summer of 1350, the population density decreased due to flight from the city from 2500 people per square mile to 1800 people per square mile. So over these fourteen days, we have population density as a function of time. Let us assume the function is linear.

Submission b):

 

Use the chain rule and this population density function to figure out the rate (FeetPerDay) per (Day) on the first of these fourteen days, and on the last of these fourteen days. Also give supporting explanations.

Watch out...look above to see what happens when the density drops below 1875 people per square mile. Also notice you are asked to deal with a numerator of FeetPerDay , and not MilesPerYear.

Submission worksheet: