The Geometry of Leibniz's Product Rule
In high school you learned by rote how to calculate the derivative of “f times g”. In first year calculus you proved it mathematically. But can you say off the cuff why it should be true?
Contents:
Credit where credit is due
You know the rule,
\[(f\cdot g)^\prime = f^\prime \cdot g +f\cdot g^\prime .\]It has a sweet geometric interpretation that we’re going to make into a p5.js (What’s p5?) interactive sketch here. This is pretty much general knowledge (Wiki, 3Blue1Brown), but I should mention I first saw it in a book by Vladimir Arnol’d. Arnol’d had a lot to say about how we teach math these days, and if what you see in this blog resonates with you, definitely check out his work.
This is going to be short
Let’s get to it. First, we draw \(f\cdot g\) as the area of a rectangle with sides \(f\) and \(g\) and imagine that both are actually some nice functions of \(t\). Something like this:
Now, we freeze frame the sketch above, say at \(t_0 = 0.7\), and scrub forward very slowly. I’ll let you do it:
How has the area \(f(t)g(t)\) changed? Put some color in that sketch and you’ll see the added area conveniently divided into three small-ish rectangles:
- The red one up top has long side \(f(0.7)\) and the short side is \(g(t) - g(0.7),\) AKA what’s currently written up there after “g(t) = g(0.7) + “. The area then, is the product of the two.
- Similarly, the red one to the right has area \(g(0.7) \cdot (f(t) - f(0.7))\).
- That leaves the black area, but you can see right now that it’s nothing in comparison to the red area, at least when \(t\) is close to \(0.7\), so let’s not bother with it anymore.
This is not mathematically rigorous, but you’re not here for rigor, are you?
So we know by how much the area \(f(t)g(t)\) grew, but we’re after the derivative, the rate of growth: per unit of \(t\), how much area did we get? Well, \(t\) grew by \(t-0.7\) units of whatever, so after neglecting the black area, the rate is:
\[\frac{\Delta\mathrm{Area}}{\Delta t}=\frac{f(0.7)(g(t)-g(0.7)) + g(0.7)(f(t)-f(0.7))}{t-0.7}.\]Let me distribute the denominator, here:
\[\frac{\Delta\mathrm{Area}}{\Delta t}=f(0.7)\frac{g(t)-g(0.7)}{t-0.7} + g(0.7)\frac{f(t)-f(0.7)}{t-0.7}.\]Now you see where it goes? Take the limit \(t\to 0.7\) and you get:
\[(fg)^\prime = fg^\prime + gf^\prime.\]I should say that everything is evaluated at \(0.7\), but obviously the result generalizes to any \(t_0\).
To summarize in words what we’ve just shown:
- the rate of change of the entire area \(fg\) is (up to a negligible error) the rate of change of the red areas.
- Each of these red rectangles grows proportionally to the length of only one of its sides, because the other one is fixed. The fixed side is the constant of proportionality.
- The side lengths are \(f\) and \(g\), and they alternate roles between rectangles.
Bonus round
It’s worth mentioning that all of this works perfectly fine when one (or two) of \(f\), \(g\) is decreasing:
This time we need to subtract the blue area. Conveniently, \(g^\prime\) is negative, so the formula stays the same.