The Chain Rule & Implicit Differentiation

e.g. Differentiate y = [Maple Math] three different ways

1) By using Maple:

> Diff((x^3+1)^2,x);

[Maple Math]

> value(%);

[Maple Math]

2) By using the product rule:

> Diff(x^3+1,x)*(x^3+1)+(x^3+1)*Diff(x^3+1,x);

[Maple Math]

> value(%);

[Maple Math]

3) By expanding and differentiating term-by-term:

> equ:=expand((x^3+1)^2);

[Maple Math]

> diff(equ,x);

[Maple Math]

Chain Rule

1) If y = f(u) and u = g(x) (where f and g are differentiable functions) then y is a differentiable function of x and [Maple Math] = [Maple Math] [Maple Math] .

2) If F(x) = f(g(x)) where f and g are differentiable functions then F'(x) = f'(g(x))g'(x)

Now , apply the chain rule in each of its forms above to y = [Maple Math] .

General Power Rule : If f is any differentiable function and n [Maple Math] N then [Maple Math] = [Maple Math] f'( x ) .

e.g. Differentiate [Maple Math] two ways and show that they are equal.

1) By Maple directly:

> Diff((x^3-2*x+2)^15,x);

[Maple Math]

> value(%);

[Maple Math]

2) By first expanding and then going term-by-term:

> expand((x^3-2*x+2)^15);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> diff(%,x);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> factor(%);

[Maple Math]

General Trig Derivatives

Suppose that f is a differentiable function, then:

[Maple Math] = cos(f(x)f'(x) [Maple Math] = -sin(f(x))f'(x)

[Maple Math] = [Maple Math] f'(x) [Maple Math] = sec(f(x))tan(f(x))f'(x)

[Maple Math] = [Maple Math] f'(x) [Maple Math] = -csc(f(x))cot(f(x))f'(x)

> Diff(sin(x^3)*sin(x)^3,x);

[Maple Math]

> value(%);

[Maple Math]

E.G.s

> eg1:=sqrt(x+(sqrt(x^2+1)));eg2:=sqrt(1+tan(x^2));

[Maple Math]

[Maple Math]

> diff(eg1,x);diff(eg2,x);

[Maple Math]

[Maple Math]

> simplify(%%);

[Maple Math]

#63, page 223, Stewart The displacement of a particle on a vibrating string is given by the equation [Maple Math] where s is in centimeters and t in seconds. i) Find the velocity in t seconds. ii) Determine when the velocity is zero. iii) Determine when the velocity is at a maximum.

i)

> s:=t->10+1/4*sin(10*Pi*t);

[Maple Math]

> velocity:=diff(s(t),t);

[Maple Math]

ii)

> plot(velocity,t=-1/2..1/2,colour=black);

[Maple Plot]

> solve(velocity=0);

[Maple Math]

Full answer: The velocity is zero when t = [Maple Math] for n [Maple Math] N . WHY?!

iii) The velocity is at a maximum wherever the tangent line to the velocity graph has zero slope (WHY?). Therefore we need to consider the derivative of the velocity function.

> diff(velocity,t);

[Maple Math]

> solve(%=0);

[Maple Math]

Real answer : Velocity a maximum whenever t = [Maple Math] for for n [Maple Math] N . WHY?!

e.g. Let f(x) = [Maple Math] .Find f' and compare and comment on the graphs of f and f'.

> eg3:=sqrt(1-x^2)/x;

[Maple Math]

> diff_eg3:=diff(eg3,x);

[Maple Math]

> plot({eg3,diff_eg3},x=-1.5..1.5,y=-10..10,colour=[black,red],thickness=2,discont=true);

[Maple Plot]

Implicit Differentiation

> with(plots):

The equations [Maple Math] , [Maple Math] , [Maple Math] are all examples of explicit functions of two variables: the first two show y as an explicit function of x, the last displays s as an explicit function of t. However, not all equations involving two variables show one as an explicit function of the other. Two examples:

> eg1:=x^2+y^2=4;eg2:=x^3+y^3=6*x*y;

[Maple Math]

[Maple Math]

> implicitplot(eg1,x=-2..2,y=-2..2,colour=black);

[Maple Plot]

> implicitplot(eg2,x=-4..4,y=-4..4,numpoints=4000,colour=black,thickness=2);

[Maple Plot]

> solve(eg1,y);

[Maple Math]

> solve(eg2,y);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

From the plots above (and the Maple commands that follow them) you can see that an equation involving two variables that does not define one variable explicitly as a function of the other variable may nevertheless define (one or more) a functional relationship implicitly between the variables.

In the first e.g., to say that [Maple Math] defines y implicitly as a function of x means that there exists an f(x) (perhaps many!) such that [Maple Math] satisfies [Maple Math] . There are 2 such f(x)'s displayed above.

Similarly, [Maple Math] defines y implicitly as a function of x means there exists at least one f(x) such that [Maple Math] . Above are displayed three such functions, although two of them involve the C omplex number system.

Note: even though an equation may define an implicit functional relationship between two variables it may not be possible or practical to solve for one of the variables explicitly . The second equation above shows that even though solving explicilty is possible, it certainly is not practical.

Now, even though you may not have an explicit functional relationship y = f(x) you may still want to be able to use differentiation to study the relationship between x and y, for instance, to compute tangent lines to the graph of the equation or to find the rate of change of one variable with respect to the other at certain points..

When an equation defines y implicitly as a function of x, you can find [Maple Math] by the process of implicit differentiation . The technique depends on the realization that if y = f(x) then you need to use the chain rule when differentiating functions of y.

e.g. 1) Suppose y = f(x), then [Maple Math] = [Maple Math] = [Maple Math] y' .

2) Suppose y = g(t), then [Maple Math] = [Maple Math] [Maple Math] = [Maple Math] g'(t).

Implicit Differentiation Procedure: If y is defined implicitly as a function of x by an equation and you want to determine [Maple Math] , then:

-- Differentiate both sides of the equation with respect to x, using the chain rule wherever appropriate.

-- Put all the terms involving [Maple Math] on the left hand side and all other terms on the right hand side.

-- Factor out [Maple Math] on the left hand side.

-- Solve for [Maple Math] by multiplying or dividing by the appropriate term.

> eg1;d0:=implicitdiff(eg1,y,x);

[Maple Math]

[Maple Math]

Reconcile the the above answer with the "explicit" derivative below.

> functions:=solve(eg1,y);

[Maple Math]

> f1:=functions[1];f2:=functions[2];

[Maple Math]

[Maple Math]

> d1:=diff(f1,x);d2:=diff(f2,x);

[Maple Math]

[Maple Math]

> subs(y=f1,d0);subs(y=f2,d0);

[Maple Math]

[Maple Math]

e.g. tangent line

Show that (1,-2) is on the graph of [Maple Math] and find the tangent line to the graph at that point.

> curve:=x^2*y^2+x*y=2;

[Maple Math]

> subs({x=1,y=-2},curve);

[Maple Math]

==> (1,-2) is on the graph since it satisfies (produces truth) the equation of the graph.

> derivative:=implicitdiff(curve,y,x);

[Maple Math]

> slope:=subs({x=1,y=-2},derivative);

[Maple Math]

> tangentline:=y-(-2)=slope*(x-1);

[Maple Math]

> implicitplot({curve,tangentline},x=-6..6,y=-6..6,numpoints=4500,colour=black);

[Maple Plot]

e.g. Orthogonal Trajectories

Definition : Two intersecting curves are orthogonal if at each intersection point their tangent lines are perpendicular (or "normal").

Two families of curves are orthogonal trajectories of each other if every curve in one family is orthogonal to every curve in the other family. (See e.g. #4 on page 162 in Stewart.)

#39 p 163. Show that the two families are orthogonal trajectories of each other: [Maple Math] and

> family1:=y=c*x^2;family2:=x^2+2*y^2=k;

[Maple Math]

[Maple Math]

> curve1:=subs(c=3,family1);curve2:=subs(c=-1,family1);curve3:=subs(c=2,family1);curve4:=subs(k=1,family2);curve5:=subs(k=4,family2);curve6:=subs(k=9,family2);curve7:=subs(c=-1/3,family1);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> p1:=implicitplot(curve1,x=-3..3,y=-3..3,colour=red):
p2:=implicitplot(curve2,x=-3..3,y=-3..3,colour=violet):
p3:=implicitplot(curve3,x=-3..3,y=-3..3,colour=blue):
p4:=implicitplot(curve4,x=-3..3,y=-3..3,colour=magenta):
p5:=implicitplot(curve5,x=-3..3,y=-3..3,colour=brown):
p6:=implicitplot(curve6,x=-3..3,y=-3..3,colour=black):
p7:=implicitplot(curve7,x=-3..3,y=-3..3,colour=khaki):

> display({p1,p2,p3,p4,p5,p6,p7},thickness=2);

[Maple Plot]

> derivative1:=implicitdiff(family1,y,x);derivative2:=implicitdiff(family2,y,x);

[Maple Math]

[Maple Math]

> derivative1*derivative2;

[Maple Math]

And that means the two families are orthogonal. WHY?!

Higher Derivatives

Assuming that f is a funtion such that the indicated derivatives exist :

The first derivative of f w.r.t. x is y' = f'(x) = [Maple Math] = the first order derivative of y w.r.t. x ,

The second derivative of f w.r.t. x is y'' = f''(x) = [Maple Math] = [Maple Math] = the second order derivative of y w.r.t. x ,

The third derivative of f w.r.t. x is y''' = f'''(x) = [Maple Math] = [Maple Math] = the third order derivative of y w.r.t. x ,

*

*

*

The [Maple Math] derivative of f w.r.t. x is [Maple Math] = [Maple Math] (x) = [Maple Math] = = the [Maple Math] order derivative of y w.r.t. x.

The student should see eg's #1,2,3,4,5 on pages 164-166

e.g. Find all the [Maple Math] order derivatives of [Maple Math]

The [Maple Math] order derivative is:

:

> d0:=x^4-3*x^2+sqrt(7)*x-3;

[Maple Math]

The first order derivative is:

> d1:=diff(d0,x);

[Maple Math]

The second order derivative is:

> d2:=diff(d1,x);

[Maple Math]

The third order derivative is:

> d3:=diff(d2,x);

[Maple Math]

The fourth order derivative is:

> d4:=diff(d3,x);

[Maple Math]

The fifth (and all subsequent) order derivative is:

> d5:=diff(d4,x);

[Maple Math]

e.g. Find the acceleration

Find the acceleration of a particle at t = 2 seconds if its position in meters from (0,0) at time t is given by [Maple Math] . Realize: acceleration is the rate of change of velocity which, in turn, is the rate of change of position. Hence, acceleration is measured by the second derivative of position.

> s:=2*sin(2*t-3);

[Maple Math]

> velocity:=diff(s,t);

[Maple Math]

> evalf(subs(t=2,velocity));

[Maple Math]

> acceleration:=diff(velocity,t);

[Maple Math]

==> after 2 seconds the acceleration will be:

> subs(t=2,acceleration);

[Maple Math]

> evalf(%);

[Maple Math]

==> At 2 seconds, the particle will be moving at about 2 m/s and losing speed at the rate of about -6.7 m / [Maple Math] .

?? Why are the acceleration units meters/ [Maple Math] ??

#51, page 239

A mass on vertical spring moves according to [Maple Math] .

1) Show that the acceleration is proportional to the displacement

2) Show that the speed is a maximum when the acceleration is zero.

1:

> displacement:=A*sin(omega*t);

[Maple Math]

> velocity:=diff(displacement,t);

[Maple Math]

> acceleration:=diff(velocity,t);

[Maple Math]

Note : acceleration = [Maple Math] = [Maple Math] ==> acceleration is proportional to displacement since [Maple Math] is a constant .

2:

Since [Maple Math] and the velocity is [Maple Math] where [Maple Math] is a constant, the speed will be at a maximum wherever [Maple Math] is at a maximum. i.e . whenever [Maple Math] = 1.

> solve(abs(cos(omega*t))=1,t);

[Maple Math]

Full answer: [Maple Math] where k [Maple Math] N.

> assume(k,integer);subs(t=(k*Pi)/omega,acceleration);

[Maple Math]

> simplify(%);

[Maple Math]

Note : this is not what was asked! The above shows that if the speed is at a maximum then the acceleration is zero. We want the converse .

> solve(acceleration=0,t);

[Maple Math]

Full answer: [Maple Math] and this is precisely where [Maple Math] = 1 which is precisely where the speed is at a maximum.

Find a polynomial

Find a third degree polynomial p, satisfying p(0) = 6, p'(2) = -1, p''(1) = 2, p'''(-1) = 6.

> p:=a*x^3+b*x^2+c*x+d;

[Maple Math]

> d1:=diff(p,x);

[Maple Math]

> d2:=diff(d1,x);

[Maple Math]

> d3:=diff(d2,x);

[Maple Math]

> subs(x=-1,d3);

[Maple Math]

> solve(subs(x=-1,d3)=6,a); (This is Solve(p'''(-1) = 6), and the result is a )

[Maple Math]

> d2:=subs(a=1,d2);

[Maple Math]

> solve(subs(x=1,d2)=2,b); (This is Solve(p''(1) = 2) and the result is b )

[Maple Math]

> d1:=subs([a=1,b=-2],d1);

[Maple Math]

> subs(x=2,d1);

[Maple Math]

> solve(subs(x=2,d1),c); (This is "solve(p'(2) = -1" and the result is c .)

[Maple Math]

> d0:=subs([a=1,b=-2,c=-4],p);

[Maple Math]

> subs(x=0,d0);

[Maple Math]

> solve(subs(x=0,d0)=6,d); (This is "solve(p(0) = 6" and the result is d. )

[Maple Math]

> polynomial:=subs([a=1,b=-2,c=-4,d=6],p);

[Maple Math]

> plot(polynomial,x=-4..4,y=-12..12,colour=red,thickness=2);

[Maple Plot]

>