NapkinCalc

Calculus 1B — The Derivative

The chain rule

continues from lesson 3 — values defined earlier in the course stay live here

ELI5: a function inside another function is like two meshed gears — turn the outer one and the inner one drives it. The chain rule says: multiply the outer slope by the inner slope. d/dx f(g(x)) = f′(g(x)) · g′(x).

diff((3x2+1)5,x)\mathrm{diff}\left(\left(3 \cdot x^{2} + 1\right)^{5}, x\right) = 30(3x2+1)4x30 \cdot \left(3 \cdot x^{2}+1\right)^{4} \cdot x chain rule: 30x(3x² + 1)⁴ — Steps unpacks the gears
diff(sin(x2),x)\mathrm{diff}\left(\mathrm{sin}\left(x^{2}\right), x\right) = 2cos(x2)x2 \cdot \mathrm{cos}\left(x^{2}\right) \cdot x inner x² ⇒ 2x·cos(x²)

Real-world hook: drop a stone in a pond. The ripple's area grows because its radius grows because time passes — three linked rates, multiplied together. That's the chain rule, and it's the backbone of "related rates" in part 1C.

hch(x)=sin(x2)h_{ch}\left(x\right) = \mathrm{sin}\left(x^{2}\right) a function-inside-a-function

Try it yourself: what is the slope of sin(x²) at x = 1? (Chain rule: 2x·cos(x²), so 2·cos 1 ≈ 1.0806.)

chainat1=2cos(1)chain_{at1} = 2 \cdot \mathrm{cos}\left(1\right) = 1.08061.0806 ✏️ Your turn: replace 0 with the slope of sin(x²) at x = 1. (Try 2·cos(1).)
✓ pass abs(chainat1hch(1+0.00001)hch(10.00001)20.00001)<0.01\mathrm{abs}\left(chain_{at1} - \frac{\mathrm{h_{ch}}\left(1 + 0.00001\right) - \mathrm{h_{ch}}\left(1 - 0.00001\right)}{2 \cdot 0.00001}\right) < 0.01 green when it matches the real slope of sin(x²) at x = 1