The Chain Rule & Implicit Differentiation
e.g. Differentiate y =
three
different ways
1) By using Maple:
> Diff((x^3+1)^2,x);
> value(%);
2) By using the product rule:
> Diff(x^3+1,x)*(x^3+1)+(x^3+1)*Diff(x^3+1,x);
> value(%);
3) By expanding and differentiating term-by-term:
> equ:=expand((x^3+1)^2);
> diff(equ,x);
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
=
.
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 =
.
General Power Rule
: If f is
any
differentiable function and n
N
then
=
f'(
x
) .
e.g.
Differentiate
two ways and show that they are equal.
1) By Maple directly:
> Diff((x^3-2*x+2)^15,x);
> value(%);
2) By first expanding and then going term-by-term:
> expand((x^3-2*x+2)^15);
> diff(%,x);
> factor(%);
General Trig Derivatives
Suppose that f is a differentiable function, then:
= cos(f(x)f'(x)
= -sin(f(x))f'(x)
=
f'(x)
= sec(f(x))tan(f(x))f'(x)
=
f'(x)
= -csc(f(x))cot(f(x))f'(x)
> Diff(sin(x^3)*sin(x)^3,x);
> value(%);
E.G.s
> eg1:=sqrt(x+(sqrt(x^2+1)));eg2:=sqrt(1+tan(x^2));
> diff(eg1,x);diff(eg2,x);
> simplify(%%);
#63, page 223, Stewart
The displacement of a particle on a vibrating string is given by the equation
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);
> velocity:=diff(s(t),t);
ii)
> plot(velocity,t=-1/2..1/2,colour=black);
> solve(velocity=0);
Full answer:
The velocity is zero when t =
for n
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);
> solve(%=0);
Real answer
: Velocity a maximum whenever t =
for for n
N
.
WHY?!
e.g.
Let f(x) =
.Find f' and compare and comment on the graphs of f and f'.
> eg3:=sqrt(1-x^2)/x;
> diff_eg3:=diff(eg3,x);
> plot({eg3,diff_eg3},x=-1.5..1.5,y=-10..10,colour=[black,red],thickness=2,discont=true);
Implicit Differentiation
> with(plots):
The equations
,
,
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;
> implicitplot(eg1,x=-2..2,y=-2..2,colour=black);
> implicitplot(eg2,x=-4..4,y=-4..4,numpoints=4000,colour=black,thickness=2);
> solve(eg1,y);
> solve(eg2,y);
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
defines y
implicitly
as a function of x means that there exists an f(x) (perhaps many!) such that
satisfies
. There are 2 such f(x)'s displayed above.
Similarly,
defines y
implicitly
as a function of x means there exists at least one f(x) such that
. 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
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
=
=
y'
.
2)
Suppose y = g(t), then
=
=
g'(t).
Implicit Differentiation Procedure:
If y is defined implicitly as a function of x by an equation and you want to determine
, then:
-- Differentiate both sides of the equation with respect to x, using the chain rule wherever appropriate.
-- Put all the terms involving
on the left hand side and all other terms on the right hand side.
-- Factor out
on the left hand side.
-- Solve for
by multiplying or dividing by the appropriate term.
> eg1;d0:=implicitdiff(eg1,y,x);
Reconcile the the above answer with the "explicit" derivative below.
> functions:=solve(eg1,y);
> f1:=functions[1];f2:=functions[2];
> d1:=diff(f1,x);d2:=diff(f2,x);
> subs(y=f1,d0);subs(y=f2,d0);
e.g. tangent line
Show that (1,-2) is on the graph of
and find the
tangent line
to the graph at that point.
> curve:=x^2*y^2+x*y=2;
> subs({x=1,y=-2},curve);
==> (1,-2) is on the graph since it satisfies (produces truth) the equation of the graph.
> derivative:=implicitdiff(curve,y,x);
> slope:=subs({x=1,y=-2},derivative);
> tangentline:=y-(-2)=slope*(x-1);
> implicitplot({curve,tangentline},x=-6..6,y=-6..6,numpoints=4500,colour=black);
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:
and
> family1:=y=c*x^2;family2:=x^2+2*y^2=k;
> 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);
>
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);
> derivative1:=implicitdiff(family1,y,x);derivative2:=implicitdiff(family2,y,x);
> derivative1*derivative2;
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) =
= the
first order derivative of y w.r.t. x
,
The second derivative
of f w.r.t. x is y'' = f''(x) =
=
= the
second order derivative of y w.r.t. x
,
The third derivative
of f w.r.t. x is y''' = f'''(x) =
=
= the
third order derivative of y w.r.t. x
,
*
*
*
The
derivative
of f w.r.t. x is
=
(x) =
= = the
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
order derivatives of
The
order derivative is:
:
> d0:=x^4-3*x^2+sqrt(7)*x-3;
The first order derivative is:
> d1:=diff(d0,x);
The second order derivative is:
> d2:=diff(d1,x);
The third order derivative is:
> d3:=diff(d2,x);
The fourth order derivative is:
> d4:=diff(d3,x);
The fifth (and all subsequent) order derivative is:
> d5:=diff(d4,x);
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
.
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);
> velocity:=diff(s,t);
> evalf(subs(t=2,velocity));
> acceleration:=diff(velocity,t);
==> after 2 seconds the acceleration will be:
> subs(t=2,acceleration);
> evalf(%);
==> At 2 seconds, the particle will be moving at about 2 m/s and losing speed at the rate of about
-6.7 m
/
.
??
Why are the acceleration units meters/
??
#51, page 239
A mass on vertical spring moves according to
.
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);
> velocity:=diff(displacement,t);
> acceleration:=diff(velocity,t);
Note
: acceleration =
=
==> acceleration is proportional to displacement since
is a
constant
.
2:
Since
and the velocity is
where
is a constant, the speed will be at a maximum wherever
is at a maximum.
i.e
.
whenever
= 1.
> solve(abs(cos(omega*t))=1,t);
Full answer:
where k
N.
> assume(k,integer);subs(t=(k*Pi)/omega,acceleration);
> simplify(%);
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);
Full answer:
and this is
precisely
where
= 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;
> d1:=diff(p,x);
> d2:=diff(d1,x);
> d3:=diff(d2,x);
> subs(x=-1,d3);
> solve(subs(x=-1,d3)=6,a); (This is Solve(p'''(-1) = 6), and the result is a )
> d2:=subs(a=1,d2);
> solve(subs(x=1,d2)=2,b); (This is Solve(p''(1) = 2) and the result is b )
> d1:=subs([a=1,b=-2],d1);
> subs(x=2,d1);
> solve(subs(x=2,d1),c); (This is "solve(p'(2) = -1" and the result is c .)
> d0:=subs([a=1,b=-2,c=-4],p);
> subs(x=0,d0);
> solve(subs(x=0,d0)=6,d); (This is "solve(p(0) = 6" and the result is d. )
> polynomial:=subs([a=1,b=-2,c=-4,d=6],p);
> plot(polynomial,x=-4..4,y=-12..12,colour=red,thickness=2);
>