← Return to lessonClass materials · 3.1a
The Chain Rule
Lecture transcript
0:00Quick gut check before we start. You already know the derivative of sine x. It's cosine x. Clean and simple. So what about sine two x? Is it just cosine two x? If your gut said yes, you're in good company. Almost everybody says yes the first time. Hold on to that guess, because we're going to test it. By the end, you'll see why the inside's derivative gets multiplied, not just memorize it. And you'll peel apart two, three, even nastier layers without dropping the inside's derivative, the exact slip the AP course guide warns about.
0:39Let's go get that five. Let's test it. Put sine x and sine two x side by side. Sine two x runs the exact same wave, just on fast-forward: twice as fast. Watch them both leave zero. At zero, sine x climbs out with slope one. Sine two x shoots out twice as steep, with slope two. Why? The inside, two x, moves twice as fast as x.
1:11So every slope along the wave gets multiplied by two. So cosine two x isn't the whole story. Our new guess: the derivative of sine two x is two cosine two x. Let's see why. Look at three x plus one, squared. That's two jobs, one right after the other. First job, the inside: take x, triple it, add one. Call that u. u equals three x plus one.
1:42Second job, the outside: square what you got. y equals u squared. In general, y equals f of g of x. g works first, on the inside. f works last, on the outside. Can't tell which part is the inside? Pretend you're putting a number, like five, into a calculator. Whatever you'd compute first is the inside. Try it on sine squared x. That's sine x, squared: you take the sine first, so sine x is the inside.
2:16But sine of x squared: you square first, so x squared is the inside. And if the inside is just x? Its derivative is one. Times one changes nothing, so you never even noticed it. Back to three x plus one, squared. We can also go the long way. Expand: nine x squared, plus six x, plus one. Take the derivative, term by term: eighteen x, plus six. Now factor it a sneaky way: two, times three x plus one, times three.
2:51Look at the pieces. Two times three x plus one: that's the outside's derivative, with the inside left alone. And the extra three tagging along? The inside's slope. Maybe that's a fluke, you might say. So try a curved inside: x squared plus one, squared. Expand: x to the fourth, plus two x squared, plus one. Take the derivative: four x cubed, plus four x. Factor it the same way: two, times x squared plus one, times two x.
3:27Look at the tag-along this time. It isn't a number anymore... It's two x: the inside's derivative. Bet you can beat the algebra now. Call the shot on the cube before you expand it: three, times x squared plus one, squared, times two x. Check it once the long way. Expand: x to the sixth, plus three x to the fourth, plus three x squared, plus one. Its derivative: six x to the fifth, plus twelve x cubed, plus six x.
4:00And the guess multiplies out to six x to the fifth, plus twelve x cubed, plus six x. An exact match. We've seen that it works. But why do the slopes multiply, instead of add? Let's prove it, straight from the definition. By definition, the derivative of f of g of x is the limit, as h goes to zero, of f of g of x plus h, minus f of g of x, all over h.
4:30That's crowded. So give the two insides names. The triangle is g of x plus h. The square is g of x. So it's the limit of f of triangle, minus f of square, over h. Now multiply and divide by triangle minus square: g of x plus h, minus g of x. As long as the inside really moves, that's not zero, so we're allowed. That splits into a product of fractions: f of triangle minus f of square, over triangle minus square... times g of x plus h, minus g of x, over h.
5:13As h goes to zero, where does the triangle go? The triangle slides right into the square, because g is differentiable, so it's continuous. No jumps. The first fraction: the change in f over the change in its input, with the triangle heading to the square. It has the same form as the derivative at a point: f of t minus f of a, over t minus a, as t goes to a. Here the triangle plays t, and the square plays a.
5:45Since f is differentiable at the square, that's f prime of the square: f prime of g of x. And the second fraction is just the definition of g prime of x. So the derivative of f of g of x is f prime of g of x, times g prime of x. Letters make this easier to carry around. Call the square u. u is g of x, and y is f of u. Then f prime of g of x is dy du: how fast y changes with u.
6:21And g prime of x is du dx: how fast u changes with x. So dy dx is dy du, times du dx. The du's look like they cancel, but dy du and du dx aren't plain fractions: the rates multiply. On our example: u is three x plus one, and y is u squared. dy du is two u, du dx is three.
6:51Two u times three is six u. Put u back: six times three x plus one, eighteen x plus six, the same as the long way. And officially, this has a name: the chain rule. For g differentiable at x and f differentiable at g of x, the derivative of f of g of x is f prime of g of x, times g prime of x. Say it like this: the outside's derivative, with the inside kept just as it is, times the inside's derivative.
7:23Outside first, then inside. So, our opening bet. The outside is sine, so cosine two x, with the two x kept inside, times the inside's derivative, two... Two cosine two x, just what the graph showed at zero. Some shapes show up all the time. Put the inside in a box. A power of the box gives n times the box to the n minus one... times the box's derivative.
7:53e to the box gives e to the box, unchanged... times the box's derivative. The natural log of the box, with the box positive, gives one over the box, times the box's derivative... the box's derivative over the box. Sine of the box gives cosine of the box, times the box's derivative. Cosine and tangent go the same way: negative sine of the box, and secant squared of the box wherever tangent of the box is defined, each times the box's derivative.
8:25Watch that minus sign. And a square root, with the box positive: the power rule again, the box's derivative, over two root the box. These aren't new rules to cram. It's one move in different outfits: the outside's derivative, the box kept, times the box's derivative. Three functions stacked inside each other? Peel them one at a time, from the outside in. Take e to the sine of four x. An e on the outside, a sine in the middle, and four x deep inside.
8:57Peel the e first. It stays e to the sine of four x, unchanged. Step in and peel the sine. That gives cosine of four x, with four x kept inside. The core, four x, gives four. Now multiply all three links: e to the sine four x, times cosine four x, times four. So y prime is four cosine four x, times e to the sine four x.
9:27Link times link times link: that's why it's called a chain. The chain rule also shows where the a to the x rule comes from, for any positive base a. Rewrite it with base e. e and natural log undo each other, so a to the x is e to the natural log of a to the x. In the log of a power, the exponent hops to the front. So a to the x is e to the x natural log a. Now it's e to an inside.
10:00The outside stays, e to the x natural log a... times the inside's derivative, natural log a, because the inside is just x times that number. Put a to the x back: the derivative of a to the x is a to the x, times natural log a. For example, two to the x gives two to the x, times natural log two. Quick check: what if a is e? Natural log e is one, so e to the x stays e to the x. It fits.
10:34New today: logs of any base. Log base a of x is natural log x over natural log a, for a positive base other than one. That's the change-of-base formula, so its derivative is one over x natural log a. So log base two of x gives one over x natural log two. Example one. f of x is the square root of x squared plus five. Find f prime of x, then the tangent line at x equals two.
11:08The plan: this is a composite. The outside is a square root. The inside is x squared plus five, because you'd compute that first. So, the chain rule. Part a. Calculus likes powers better than roots, so write it as a power: x squared plus five, to the one half. The outside's derivative: one half, times x squared plus five, to the negative one half. The inside stays as it is. And don't stop writing yet: times the inside's derivative, two x.
11:43On a free response, write the whole line, times two x included. The negative one half power sends the root downstairs: two x over two root x squared plus five. The twos cancel... x over root x squared plus five. You've got f prime now. Try part b, the tangent line at x equals two, before I do. Part b. A tangent line needs two things: a point, f of two, and a slope, f prime of two.
12:15First the point. Plug two into f: root of two squared plus five... root nine, three. Then the slope. Plug two into f prime: two over root nine... two thirds. Put the point and the slope together. So here is our line: y equals three, plus two thirds, times x minus two. No need to simplify it. In the picture, the line touches the curve at two, three.
12:45There's one just like it in your workbook: catch the inside's derivative before you check the solution. Back to part a for a moment, because this is where people lose points. On the 2025 AP exam, free-response question five began with the derivative of e to an inside, and the first point was for that derivative itself: an answer alone could not earn it. Now our part a. Here's where it goes wrong: f prime of x equals one half, x squared plus five, to the negative one half... and it stops.
13:21Then f prime of two comes out one sixth. The outside's derivative is only half the job. Every time you finish an outside, ask: times what? Times the inside's derivative, two x. So f prime of x is x over root x squared plus five, and f prime of two is two thirds. Example two. h of x is x squared, times e to the negative three x. Where does its graph have a horizontal tangent line?
13:55The plan: a horizontal tangent means slope zero, so we solve h prime of x equals zero. Looks busy? It's just a product, x squared times e to the negative three x, with a chain inside, e to the negative three x. The two rules sit right under the problem. Knock out the chain first: e to the negative three x stays, times the inside's derivative, negative three. Now the product rule: two x, times e to the negative three x... plus x squared, times negative three e to the negative three x.
14:32To set it equal to zero, factor. Don't divide by x: that throws away the solution x equals zero. Pull out x, e to the negative three x. What's left: two minus three x. Can e to the negative three x ever be zero? No. e to any power is positive. So x is zero, or two minus three x is zero: x equals two thirds. So x is zero or two thirds. That's C.
15:06Choice D, zero and negative two, is what you get when the negative three goes missing: two plus x instead of two minus three x. Classic trap: the inside's derivative, dropped. Your turn: there's one like this in your workbook, a product with a chain inside. Write every factor out. Example three. f of x is sine squared of three x. Find f prime of pi over twelve.
15:36The chain rule and its shapes are under the problem. First, rewrite that floating two: sine squared of three x means sine of three x, all squared. Looks scary? It's three short links: the square, the sine, and three x. Peel them. The square gives two sine three x, the sine gives cosine three x, and the inside gives three. Two times three: six sine three x cosine three x. Now x is pi over twelve.
16:08Multiply by three first: three x is pi over four. Everybody's favorite angle. Sine of pi over four is root two over two. Cosine, the same. Six, times root two over two, times root two over two... six times two fourths. Three. So the answer is C. One more like this in your workbook. Peel it one link at a time. Back to where we started.
16:39Was the derivative of sine two x just cosine two x? Nope. It's two cosine two x, because that inside, two x, runs twice as fast. That's the chain rule: f prime of g of x, times g prime of x. The outside's derivative, with the inside kept, times the inside's derivative. And it's no magic trick. Straight from the definition, the triangle slid into the square, and the two fractions became exactly those two derivatives.
17:10More layers? Peel them one link at a time, from the outside in. Do a few in your workbook, and asking 'times what?' becomes a habit. Stuck? Ask me in the comments. Next up, three point one again: what if there's no formula at all, just a table or a graph? See you there.