AP Calculus AB — The Chain Rule and Exponential Derivatives Corrected lesson transcript ## 0:00 — The Chain Rule [0:05] Okay, our goal today is to find the derivative of functions like this. We know the derivative of sine, which is cosine. [0:18] And we know the derivative of this polynomial, which is 9x squared minus 5. [0:26] 9x squared minus 5. [0:30] But this is not a product of two functions, not a quotient of two functions, not a sum of two functions. [0:40] What is this? [0:48] This is called a composite function. [0:53] We have a function inside another function that's called a composite function. [1:15] We have some function inside another function. [1:20] So in math, a composite function, you compose two functions. You put a function inside a [1:36] function inside a function to make a new function. ## 1:47 — Inside and Outside Functions [1:55] Okay. [1:59] Alright, we often write like this [2:01] f composed with g, which means [2:05] f of g of [2:10] x or something. [2:12] Okay. Functions inside another function. [2:20] So let me write the sine of 3x cubed minus 5x plus 6. [2:39] So if my inside function is g of x, what is our g of x? [2:47] 3x cubed minus 5x plus 6. [2:52] and then my outside function would be sine of X and then Y would be f of g of [3:13] x. You plug in this everywhere you see an x and f, you get that composite function. [3:27] So sometimes we refer to it as just the inside function and the outside function. So we need [3:34] a rule called the composite function rule. ## 3:51 — The Composite Function Rule [3:59] let's I'll just tell you what it is. So the derivative of a composite function. [4:12] It turns out it's the derivative of the outside function composed with the [4:18] inside function and then you simply multiply by the derivative of the inside [4:27] function. [4:28] Let's prove this real quick. It's pretty easy. ## 4:43 — Why the Chain Rule Works [4:44] The derivative of this function. [4:48] I could say y prime. [4:50] How are we going to prove this? [4:55] The limit as. [4:59] Okay, we're actually not going to do this. We're going to use the other definition. What [5:03] was the other definition of the derivative? F prime of a is the limit. X approaches a. [5:15] f of x minus f of a, all over x minus a. That was the second definition I gave. It is easier with this definition. [5:36] We use the limit as x approaches a of f of g of x minus f of g of a, divided by x minus a. [5:52] f of g of x, our function, minus our function at the value a. [6:12] And now we need a trick. [6:15] Any guesses what the trick's going to be? [6:39] Here's the trick. We're going to multiply. We're not going to add the number zero. We [6:43] did that in the product in the quotient. Yeah. We're going to multiply by the number. What's [6:49] It's the only thing you're allowed to multiply by. It doesn't change it. Number one. [6:53] Okay, but a very special version of the number one. [7:08] Now what? [7:22] I'm just going to switch these two. [8:06] And we're almost done. [8:13] We're going to change the limit of a product to the product of two limits. [8:57] This one should be obvious. What is this? [9:06] That's the definition of the derivative of g. [9:13] That is g prime of a. [9:20] And then this is [9:25] the definition [9:27] of the derivative [9:30] of f, but not at [9:34] a. [9:38] At g of a. This is like our [9:40] value. Okay this is f prime of g of a. [9:57] So as x goes to a, this goes to g of a. [10:04] Or sorry, that goes to zero. [10:11] Anyways, and there it is. [10:41] That's the proof of the composite [10:42] I'm going to remove q of x times b times x. ## 10:43 — Sine of a Polynomial [10:45] So real quick, we know G prime of X is what, 9X squared minus 5? [10:53] f prime of x is cosine of x. [11:07] So this is f prime, but we plug in g of x in there. [11:12] So f prime is this, but instead of x, it's g of x, which is this guy. [11:20] Cosine of 3x cubed minus 5x plus 6, times g prime of x, which is 9x squared minus 5. And that is it. [11:40] The derivative of the outside function with the inside plug in there times the [11:46] derivative of the inside function. It is the composite function rule, also known as the chain rule. [12:03] Why do we call it the chain rule? Why don't we call the composite function rule? ## 12:08 — Leibniz Notation and More Layers [12:10] You could chain it or does that mean chain it? [12:13] You could chain it and make another function. [12:18] Okay so the chain rule is the composite function rule. [12:25] Again, the derivative of a composite function is the outside, [12:35] derivative of the outside, composed with the inside, times the derivative of the inside. [12:42] But it's often written like this. dy dx equals dy du times du dx. [13:12] Okay, so going back to that previous example. [13:40] Here, Y is a function of X, correct? [13:46] I don't see any u's. Y is a function of x. Okay, so what in the world does dy, du mean? Okay, [14:01] Our inside function is u: u equals 3x cubed minus 5x plus 6. Now y equals sine of u. [14:25] So dy du, now y is a function of u. dy du is simply cosine of u. du dx, the derivative [14:47] du over dx is 9x squared minus 5. So dy over du times du over dx is cosine u times 9x squared minus 5. [15:14] Except we do not want u in the final answer. [15:16] So we put what u is. [15:18] u is 3x cubed minus 5x plus 6. [15:36] Okay. [15:54] So, again, what does this have to do with chain rule or the word chain? [16:01] If you have a function inside a function inside another function, okay, dy dx is going to be dy du [16:19] times du dv times dv dx. Okay, it's a chain of a bunch of derivatives that are [16:33] all connected by the inside variable. Okay, in fact, this notation, it looks [16:40] like these all cancel and you end up with dy over dx. These aren't really [16:47] fractions so it's not how it works. This is our derivative of our function y with [16:53] respect to our variable u, derivative of our variable u with respect to variable v, [17:00] derivative of our function v with respect to x. Okay and if there's a fourth function inside [17:06] that you just multiply by the derivative of that and so on. It's a whole chain of [17:12] derivatives that are all connected by the previous function or variable. So [17:21] let's do some more examples. ## 17:23 — Exponential and Power Examples [17:23] There's a composite function [17:26] What's the inside function? [17:30] Cosine of x. Sometimes I just put a u, call that u. [17:34] You want to write it, u is cosine of x. [17:40] And if u is cosine of x, [17:42] what is our outside function? [17:45] E to the u. [17:52] Or e to the x, same thing. [17:59] Okay, so, typically we don't mess with all these U's and stuff, but let me show you both ways here. [18:11] We typically just do this, the derivative of our, what is derivative of E to the U? [18:16] The same function, E to the U, you can either put that in there or you just type it in, [18:22] or not typing any, write it in, times the derivative of the inside function, [18:28] derivative of u is? [18:31] Negative sine of x. [18:34] We'd probably write it like this. [18:41] Okay. [18:50] dy dx. [18:52] dx. Here dy du is e to the u. [19:01] du dx is [19:06] negative sine of x. [19:11] This is this, e to the u, [19:17] times du dx [19:23] and then you substitute what u is. [19:38] Let's do another one. [20:14] What's my inside function? [20:17] x to the fourth plus sine of x. I can call that u. So my outside [20:33] function is either X to the fifth or U to the fifth. So what is the derivative of [20:42] u to the fifth, 5u to the fourth. So x to the fourth plus sine of x. So derivative of the outside [20:57] function, composed with the inside, times the derivative of the inside. We definitely need [21:03] parentheses around that inside derivative; do not forget them. ## 21:09 — Combine Product and Chain Rules [21:09] Is this a composite function? [21:12] No. [21:13] What rule do we use to find the derivative? [21:16] The quotient rule. [21:16] Okay, however, is this the same function? It is. Okay, now we would use the product [21:42] rule because we have a product. And before we weren't able to do it this way because [21:48] here we got a function inside a function. Okay, so because of the chain rule you [21:56] don't ever have to use the quotient rule. You could just change it to a product. [22:12] x to the fourth. [22:15] x to the fourth. [22:44] But now, when we find the derivative of this, we need the chain rule. [22:51] What's my inside function? [22:54] Sin of x. That's my u. Okay. [22:59] So it's going to be derivative, or so my outside function is u to the negative 1 power. [23:08] What is the derivative of u to the negative 1? [23:16] What rule we use for that? [23:22] Uh oh. [23:23] Power rule, thank you. [23:25] This is going to be negative 1 u to the negative 2. [23:31] So it's going to be negative 1 sine of x to the negative 2 times the derivative of u, [23:39] derivative of sine of x which is cosine of x. If I clean this up a little bit, [23:56] is that negative x to the fourth, [24:00] cosine of x over sine of x squared. [24:10] And if you made one fraction out of this, [24:16] we have to multiply this by sine of x over sine of x. [24:22] We get 4x cubed times sine of x minus x to the fourth times cosine of x, over sine squared x. [24:49] Which is exactly, if you did the quotient rule, what you have got, the derivative of our first function times the second, or the denominator, minus the first function times the derivative of our denominator, divided by the derivatives, or sorry, the denominator. [25:03] denominator square. [25:04] Okay, so. ## 25:07 — Three Nested Functions [25:07] So here's a composite function, but it's not a composite of two functions, it's a composite [25:11] of three functions. [25:18] Okay. [25:25] If I call my very inside function u, let's call this u, no let's not do that. [25:35] Let's call this whole inside u. [25:42] We got y equals sine of u, correct? And then inside of u, sorry, so sine of u is [26:00] u equals e to the v, and v is x squared minus 5x. [26:31] Typically we don't need to do this. [26:35] Ideally we just do this. [26:37] Y prime. Derivative of our outside function which is sine. [26:42] Cosine, with the same inside expression. [26:49] Times now the derivative of the inside [26:52] which is our same function. [26:56] The derivative of the exponential is the same exponential times the derivative of its inside function, which is 2x minus 5. [27:10] Let me show you using u and v. We want dy over dx. It is dy over du, because y is a function [27:25] of u times du u is a function of v and v is a function of x. [27:47] Okay, here dy du is cosine of u du dv, [27:58] derivative of our function u with respect to v is e to the v dv dx derivative of v with [28:09] respect to x is 2x minus 5. So this is cosine of u times this du dv is e to the [28:32] times dv dx. And then simply we plug in [28:48] what u and v are. u is e to the v, v is x squared minus 5x, and I actually need that. [29:14] And then we get the same result. [29:17] You got a function inside a function inside a function, you see, multiplying by the derivative [29:25] of each inside function. [29:31] Get questions on this so far. [29:33] When do we need to use the chain rule? [29:38] Only composite functions. [29:40] Yeah, only composite functions. [29:43] exponential. [29:46] We don't know the derivative of this. ## 29:46 — Exponential Bases Other Than e [29:47] we do know the derivative of e to the x which is e to the x. We don't know the [29:56] derivative of 7 to the x. So how are we going to do this? We're definitely not going to use the [30:08] definition of the derivative. Anybody got an idea? What were you gonna say? [30:24] Oh, maybe. [30:30] Do you know [30:31] the derivative of the logs? [30:37] We don't know the derivative of the natural log. [30:49] Do we have a [30:51] change of [30:52] base formula for a logarithm? [30:54] Do we have a change of base for exponentials? [31:31] Is that the same function? [31:45] What does e to the natural log of u equal? [31:50] Simply U. Why is that? [31:57] Because E to the X and LN of X are what? [32:00] type of functions. [32:05] So there's an I. [32:08] Inverse functions. When you compose a function and it's inverse, you end up with [32:12] back to what you started with. [32:17] So e to the ln of seven to the x [32:20] is the same thing as seven to the x. Regroup that? [32:26] Okay. [32:30] Does this make sense? Okay, and then rules of logarithms. What can I do with an exponent that's [32:39] in a logarithm? We can take it out and [32:43] it becomes the coefficient. Do we agree? Natural log of 7 is just a number. It is a [33:05] constant. So let me write it one more time. [33:14] e raised to the power x times natural log of 7. [33:20] Okay. Now we're going to take the derivative of this. [33:24] What is my inside function? [33:30] Ln of seven. Sorry. Times x. [33:36] So the derivative is going to be the derivative of e to the u, which is e to [33:45] the u times the derivative, what is the derivative of the ln of 7 times x? Oh boy. [34:01] what's the derivative of 5x? 5. What's the derivative of negative 8x? What's the [34:09] The derivative of x times natural log of 7 is natural log of 7. This is a linear polynomial with a constant coefficient. [34:17] number. Okay, it's weird because you guys, your logarithms are weird, but this is [34:29] a polynomial with an unusual coefficient. The derivative of x times natural log of 7 is [34:38] ln of 7. Correct? Or am I just making up stuff? Okay, so this is the derivative of 7 of the [34:50] x. Let me remind you where we are. This is our function, [35:02] 7 to the x. Its derivative is the same function, [35:18] times the natural logarithm of its base. [35:23] there okay did it matter what the base was here what if I started with base 8 [35:34] 8 8 8 8 8 the only thing it would change would be those two numbers okay [35:49] So the derivative of any exponential function, let's call b to the x, and the base has to be greater than 0 and the base cannot equal 1. ## 36:08 — General Exponential Rule [36:09] The derivative is simply the same exact function, just like e to the x, except we multiply it [36:15] by the natural log of the base. [36:20] Okay, it was because the chain rule we're able to find the derivative of this. [36:26] So this is the derivative of any exponential function. [36:31] What's the derivative of this? [36:39] First off, constant multiple rule. It's just 5 times the derivative of 10 to the x. The derivative of 10 to the x is 10 to the x times ln of 10. [36:53] Okay, we're not using any chain rule here. We just use the chain rule to prove the [36:57] derivative of that exponential function. We now know the derivative of any exponential [37:01] function, not just e to the x. Let us do another example. ## 37:12 — An Exponential with a Secant Exponent [37:12] So this is a composite function. [37:15] What's the inside function? [37:18] Secant. [37:18] and the outside function is 8 to the x or 8 to the u so the derivative of 8 to [37:34] the u is 8 to the u times ln of 8. Okay, but u is secant of x times the derivative of the [37:50] The derivative of secant x is secant x times tangent x. If the input were something other than x, [38:15] it was like x cubed. The only thing with change would be secant of x cubed, tangent of x cubed, [38:25] we would multiply by the derivative of x cubed, which is 3x squared. [38:34] The derivative of the outside function times the derivative of the inside function, continuing inward. [38:44] This is one of our most important and valuable rules. Now we can differentiate [38:50] any kind of wacky function. Power rule, product rule, and any composition of functions.