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:I→R and g:J→R where I,J are intervals and f(I)⊆J. Suppose f is differentiable at c and g is differentiable at f(c). Then (g∘f) is differentiable at c and is:
(g∘f)′(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))x−c=g(f(x))−g(f(c))f(x)−f(c)⋅f(x)−f(c)x−c
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 y∈J define the function:
μ(y)={g(y)−g(f(c))y−f(c)y≠f(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:
limy→f(c)μ(y)=limy→f(c)g(y)−g(f(c))y−f(c)=g′(f(c))=μ(f(c))
because g itself is continuous).

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

Now let x∈I such that x≠c. 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))x−c=μ(f(x))⋅f(x)−f(c)x−climx→cg(f(x))−g(f(c))x−c=limx→c(μ(f(x))⋅f(x)−f(c)x−c)=limx→cμ(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)x≠00x=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 x≠0.

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

f1(x)={xsin⁡(1x)x≠00x=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<|x−0|=|x|<δ then choosing δ<ε works:

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

as desired.

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

limx→0f1(x)−f1(0)x−0=limx→0xsin⁡(1x)x=limx→0sin⁡(1x)

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

f2(x)={x2sin⁡(1x)x≠00x=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 x≠0. Notice that at this point:

f′(x)=2xsin⁡(1x)+x2cos⁡(1x)⋅(−1x2)=2xsin⁡(1x)−cos⁡(1x)

Now notice that as x→0 then the limit for f′(x) as x→0 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)=limx→0f2(x)−f2(0)x−0=limx→0x2sin⁡(1x)x=limx→0xsin⁡(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)=limx→cf(x)−f(c)x−c=limx→c−f(x)−f(c)x−c≥0
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)=limx→cf(x)−f(c)x−c=limx→c+f(x)−f(c)x−c≤0
As a result then 0≤f′(c)≤0 thus f′(c)=0.

☐