3.8 The Chain Rule
Imagine a physical machine comprised of interlocking gears. If the first gear (let’s call its rotation ) drives a second gear () such that one turn of produces turns of , we say the rate of change is . If this second gear drives a third gear () such that one turn of produces turns of , what is the relationship between the first and third gears?
It is intuitively obvious: turning once turns twice, and each of those two turns of turns three times. Thus, one turn of yields turns of . The rates multiply. This simple mechanical truth is the beating heart of the Chain Rule.
Before delving into infinitesimals, let us formalize this with simple linear functions. Consider a composite of two linear functions:
If we compose them, substituting into , we find:
Notice the slopes. The rate of change of is . The rate of change of is . The rate of change of the composite function is exactly their product:
For continuous and , recall the continuity of : a small change in causes a small change in , and that, in turn, causes a small change in . Now, with differentiable and , we are no longer just guaranteeing that the changes are small; we can precisely quantify these small changes.
Every differentiable function locally behaves like a linear function, . If we compose two differentiable functions, we are locally composing two linear functions. Since the slopes of linear functions multiply upon composition, the derivatives (which are just local slopes) must also multiply.
We now state this principle rigorously.
If is differentiable at and is differentiable at , then the composite function is differentiable at , and its derivative is given by
We compute the limit of the difference quotient for :
To evaluate this, we use the fact that is differentiable at . We can express the local behavior of using little- notation. Namely, an increment in the domain yields:
where represents an error term that vanishes faster than (i.e., ).
Substituting this into the numerator of our limit, we obtain:
Now, treat the quantity as a small perturbation to . Since is differentiable at , we can similarly expand as . Notice that as , as well. Thus:
Because scales linearly with , the error term is also bounded by . Thus, the entire expression simplifies nicely:
The terms cancel, leaving:
Since , the second term vanishes. We are left exactly with:
This completes the proof. ∎
The use of little- notation here is not merely pedantic; it elegantly skirts a common pothole in introductory proofs where one might naively multiply and divide by . That naive approach fails when for infinitely many near (e.g., if is constant or highly oscillatory). The linear approximation definition of the derivative handles this flawlessly.
When do we apply the chain rule? We always apply it when we can write the composition of functions with brackets:
Look for the bracket! If the inside of the bracket is the argument of some function, it’s time for chain rule. When taking the derivative, always work systematically from the outermost function to the innermost.
Consider the function . We can view this as , where the “inner” function is and the “outer” function is .
Using the power rule for the outer function and the polynomial rules for the inner function, the chain rule dictates:
3.8.1 The Chains of Leibniz
The chain rule can be used to differentiate compositions of more than two functions; indeed, this motivates its name, since we can think of this as a chain of functions composed with each other.
For example, given three functions , we can visualize the composite as in Figure 3.7 below.
Writing , we can use the chain rule to write in terms of and , then again to write in terms of and , obtaining:
It is perhaps easiest to view this using the alternate notation championed by Gottfried Wilhelm Leibniz:
where , , and .
We reiterate that although this notation makes it very tempting to view the chain rule as just a matter of “canceling the and the from the numerator and denominator,” this is not an actual proof of anything. The quantities , , and are entirely unified symbols representing limits (derivatives), not algebraic fractions.
At this stage in your mathematical journey, the symbols and have no independent meaning. (Later, in the study of differential geometry and differential forms, we will give them strict algebraic definitions, but for now, treat the “cancellation” strictly as a mnemonic device).
The function can be elegantly differentiated by introducing intermediate variables: let , let , and let .
Applying Leibniz’s chained gears (3.23), we compute:
Note that although applying (3.23) gave us an expression in terms of , , and , this is not yet our final answer! It is always necessary to go one step further and substitute and back in terms of the original variable . Doing so yields:
You will encounter this phenomenon—introducing variables to simplify the local geometry, then translating back to the global coordinates—in many other places as well.
Find the derivative of .
Hint for the reader: Do not panic at the nesting. Peel it like an onion, from outermost to innermost:
-
1.
The derivative of is .
-
2.
The derivative of is .
-
3.
The derivative of is .
Putting it all together:
3.8.2 The Derivative of the Exponential Function
We now embark on a heuristic argument to derive the derivative of .
Unfortunately, we will not be able to give a fully rigorous proof at this stage. This is the price we pay for the early transcendental approach to calculus. Of course, with sheer determination to overcome multiple technicalities, one can find the derivative of rigorously right now. However, the most mathematically natural way is to leave it until one learns the formal theory of sequences and series.
So far, we only have two pieces of information: is a natural number approximating , and it beautifully satisfies Euler’s identity:
Let us calculate the derivative of this expression with respect to :
Recalling that , we can rewrite as :
But we ultimately want the derivative of , and the above calculation only holds for a real parameter .
We are about to boldly extrapolate. We suppose that the formula we just derived, , holds for any complex number . While this is a leap of faith for now, complex analysis will later vindicate our bravery.
Using this assumption, we can write . Applying the chain rule to this carefully constructed identity yields:
And there we have it: the derivative of is itself!
Let’s us warm up with a relation between logarithm and exponential, and its application. Let be any positive number. We want to find the derivative of .
Before we formalize the derivative of a general exponential , it is instructive to look at the big picture. All exponentials are, fundamentally, the natural exponential wearing a disguise. By leveraging the identity , we can translate any problem involving arbitrary bases back into the familiar, natural language of .
We write as . Then . Using the chain rule and the fact that the derivative of is , we get that
Notice how the change of base simply summons a scaling factor of .
The function is a composition , where and . By the chain rule,
In the notation, if and , then
More generally,
for any differentiable function . Similarly, by the chain rule,
for any differentiable function .
Find the first derivative of the following expressions:
-
1.
-
2.
-
3.
.
3.8.3 Higher Derivatives
It is quite interesting that the exponential function has the derivative . This immediately implies that we can take a derivative of the derivative of , ad infinitum.
When the derivative of the derivative of exists at , it is called the second derivative of and is written in any of the following ways:
Similar notation is used for higher derivatives, sometimes with superscripts enclosed in parentheses to indicate the order. For instance, the -th derivative is denoted or .
Let us look at a simple polynomial example before returning to our exponential.
Let . Then:
Now, let us apply this to the exponential function:
Let . Then . In fact, by trivial induction:
for any positive integer .
We say that is invariant under the derivative. It is essentially the only family of functions (up to scalar multiplication) with this property.
Because is entirely characterized by its invariance under differentiation, some textbooks actually define as the unique number such that satisfies the equation:
This identity is an equation where the unknown is not a number, but a function, and the equation involves differentiation. Hence, mathematicians gave such equations a name: differential equation!
3.8.4 Cycles, Rotations, and Trigonometry: The Math of Oscillation
Higher derivatives of sine and cosine can be easily computed, and they reveal a beautiful underlying cyclic structure:
After this, the pattern repeats with every fourth derivative.
It is worth comparing this 4-cycle to the observation that:
This admits a profound geometric interpretation. Multiplying a complex number by corresponds to rotating it by 90 degrees ( radians) counter-clockwise around the origin in the complex plane.
Doing this twice corresponds to a 180-degree rotation (multiplication by ). Doing it four times returns us to where we started. Since differentiating the sine function has the same cyclic property, we can view the derivative operator acting on trigonometric functions as a translation of the argument by :
Because of this 4-cycle, computing arbitrarily high derivatives becomes an exercise in modular arithmetic.
We can compute by observing that . So the first derivatives get us exactly back to , and we thus have:
Of particular physical importance is the fact that if or (or more generally, any linear combination ), then:
This is a tremendously important example of a differential equation, one which arises naturally in almost every area of physics.
Consider an object on a spring that, at time , is displaced by a distance from its equilibrium resting position. The force acting on the object is given by Hooke’s Law: it has magnitude , where is the spring constant measuring the stiffness of the spring. Crucially, this force is a restoring force—it is directed in the opposite direction of the displacement.
If is the mass of the object, then Newton’s second law () gives us:
Let us define a natural frequency parameter , and consider a rescaled function . Using the chain rule, we can relate the derivatives of to the derivatives of :
Differentiating a second time yields:
This means that must be a function that satisfies the exact differential equation we discovered in (3.24)! While a formal proof requires the theory of linear differential equations, we can confidently state that every function satisfying can be written in the form .
Returning to our physical variables, we conclude that the displacement of the mass on the spring is given by:
This system is the quintessential example of a simple harmonic oscillator.
Prove that if is given by (3.26), then there exist constants and (an amplitude and a phase shift) such that:
To test your intuition on higher derivatives, polynomials, and cyclic trigonometric functions, try the following
Find given that
Hint: What happens to a polynomial of degree 100 after 101 derivatives? For the sine term, don’t forget the chain rule, and recall our modular arithmetic trick!