Lecture 29 - Chain Rule

Announcements

Keep in mind:

  • Monday: No Class
  • Tuesday: Review
  • Wednesday: Exam III

Now we have enough info to derive the Chain Rule:

Chain Rule

Let f:IR and g:JR where I,J are intervals and f(I)J. Suppose f is differentiable at c and g is differentiable at f(c). Then (gf) is differentiable at c and is:
(gf)(c)=g(f(c))f(c)

It is tempting to use, in a similar way of deriving the Algebraic Differentiability Theorem, via the difference quotient:
g(f(x))g(f(c))xc=g(f(x))g(f(c))f(x)f(c)f(x)f(c)xc
Which we cannot use directly. We'll have to do some work to justify the f(x),f(c) bits in order to use this, which we do via μ below.

Proof

For yJ define the function:
μ(y)={g(y)g(f(c))yf(c)yf(c)g(f(c))y=f(c)
Now notice that μ is continuous at f(c) (J is on an interval, and since f(c) then:
limyf(c)μ(y)=limyf(c)g(y)g(f(c))yf(c)=g(f(c))=μ(f(c))
because g itself is continuous).

Now also notice that yJ, we claim that:
g(y)g(f(c))=μ(y)(yf(c))
which is true since when yf(c) it's definitely true (multiply it out) and for y=f(c) then the LHS becomes 0, which equals the RHS.

Now let xI such that xc. Apply the above with y=f(x). Then:
g(f(x))g(f(c))=μ(f(x))(f(x)f(c))g(f(x))g(f(c))xc=μ(f(x))f(x)f(c)xclimxcg(f(x))g(f(c))xc=limxc(μ(f(x))f(x)f(c)xc)=limxcμ(f(x))f(c)
(note we used the Algebraic Limit Theorem for Functional Limits on the last step). Now because f is continuous at c and μ is continuous, then fμ is continuous at c and thus it's limit is g(f(c)). As such then:
=μ(f(c))f(c)=g(f(c))f(c)
as desired.

The chain rule helps especially to show when a function is differentiable. For example, can you find a function that's differentiable on R who's derivative is not continuous on R? For example, the absolute value function |x| does this kind-of at 0, but it isn't even differentiable at that point.

In fact, maybe it's a reasonable guess that it's impossible! To investigate it further let's look at some important examples.

Important Examples of Peculiarly Derived Functions

Consider the example 5 from before:

f0(x)={sin(1x)x00x=0
---
title: 
xLabel: 
yLabel: 
bounds: [-1,1,-1,1]
disableZoom: false
grid: true
---
f(x) = sin(1/x)

It's not continuous at x=0 but is continuous everywhere else. But by the Chain Rule then f0(x) it is differentiable at all x0.

Now consider trying to make the function continuous, essentially squeezing the function towards 0 as x0. The idea is that:

f1(x)={xsin(1x)x00x=0

If we plot this instead:

---
title: 
xLabel: 
yLabel: 
bounds: [-1,1,-1,1]
disableZoom: false
grid: true
---
f(x)= x*sin(1/x)

We can show that f1(x) is continuous at x=0 because:

|f1(x)f1(0)|=|x||sin(1x)||x|

So if 0<|x0|=|x|<δ then choosing δ<ε works:

|f1(x)||x|<δ<ε

as desired.

Now by the Chain Rule then f1 is differentiable at x0, but what about x=0? Let's check:

limx0f1(x)f1(0)x0=limx0xsin(1x)x=limx0sin(1x)

does not exist. But now we can try to go one step further by making f1 more "flat" as x0. Define it as:

f2(x)={x2sin(1x)x00x=0
---
title: 
xLabel: 
yLabel: 
bounds: [-0.5,0.5,-0.5,0.5]
disableZoom: false
grid: true
---
f(x) = x^2 * sin(1/x)

Will this smoothing work? Certainly it's continuous at x=0 (just use the Algebraic Continuity Theorem here using f1). For differentiability by the Chain Rule then f2 is differentiable at all x0. Notice that at this point:

f(x)=2xsin(1x)+x2cos(1x)(1x2)=2xsin(1x)cos(1x)

Now notice that as x0 then the limit for f(x) as x0 doesn't exist. But this argument actually doesn't work for finding the derivative at 0! Directly using the definition of a derivative then we can show it actually is differentiable there. At 0:

f(0)=limx0f2(x)f2(0)x0=limx0x2sin(1x)x=limx0xsin(1x)=0

Due to f1(x) being continuous at 0 (giving the result of the limit) thus f2 is differentiable over all R.

Back to More Theorems

We can prove the Interior Extremum Theorem, also known as a Fermat's Theorem.

This is also known as Fermat's Theorem.

Interior Extremum Theorem

Let f:(a,b)R. Suppose f has a maximum or minimum at some c(a,b), and suppose f is differentiable at c. Then f(c)=0.

Proof

Without loss of generality, suppose f(c) is a maximum. Then x(a,b) then f(x)f(c). Now a<c<b, so then we can make a sequence on the right and left of c. Namely, since f is differentiable at c, then:
f(c)=limxcf(x)f(c)xc=limxcf(x)f(c)xc0
Because f(x)f(x)0 (using f(c) is a maximum) and via the Limits and Order (Order Limit Theorem) (extending it to limits of functions). Similarly:
f(c)=limxcf(x)f(c)xc=limxc+f(x)f(c)xc0
As a result then 0f(c)0 thus f(c)=0.