 This lesson is on the chain rule, or taking derivatives of composite functions. So if we are given a composite function which is y is equal to f of g of x, then the derivative of this, y prime, is the derivative of the f prime with the g of x in there times the g prime of x. So we can write this in another way. If y is equal to f of g of x and u is equal to g of x, then we can figure out that dy dx is dy du du dx. This is where dy du is equal to f prime at u and du dx is equal to the g prime, which we just said previously. So what we want to do is kind of peel an orange, an onion, whatever you want to think of this as, and that will be how we will use the chain rule. We will be peeling away at our functions. Let's try just a word problem and to get this nailed down a little bit more. Suppose the length L in centimeters of a steel bar depends on the air temperature, which is h degrees centigrade, and that h depends on time, which is hours, and you can see that composite idea forming, one is dependent on another. If the length increases by two centimeters for every degree increase in the temperature, and the temperature is increasing at three degrees centigrade per hour, how fast is the length of the bar increasing? So we have two things happening here. The length increases by two centimeters for every degree, and the temperature is increasing at three degrees centigrade per hour. So we know that the rate of increasing in length is two. The rate of increasing in temperature is three. So the total rate change is really a dl dt, which is equal to the dl dh times dh dt. And this first one is the increase in the length, and the other one is the increase in the temperature. And of course they are multiplied together, so we can multiply the two times the three and get six and get the rate of increase for the length. That is how we use our composite function. Conclusion. The chain rule is used to determine instantaneous rate of change of functions, which means instantaneous rate of change means the first derivative, which depend on other functions, and that means we are dealing again with composite functions, f of g of x's. So let's try some examples. The first one says f of x is equal to cosine of e to the x. There is g of x function, the e to the x, and the cosine is the f of x function. So our f prime of x is equal to the derivative of the cosine, which is negative sine, and of course we carry along the e to the x, and then we take the derivative of the inside, which is e to the x, and the derivative of e to the x is e to the x. So our final answer should be cleaned up to negative e to the x sine e to the x. Again, we took the derivative on what we call the outside f function and made derivative of cosine negative sine, and then we went inside and took the derivative on e to the x, which indeed was e to the x. Let's try another one. f of x is equal to the square root of sine x. Well, we can see that the outside function is a power function, something to the one-half power, and the inside function is our sine x. So to do this problem, f prime of x is equal to the outside being quantity to the one-half, so we take that derivative first, one-half, whatever is in the parentheses, to the negative one-half. Then we go inside the parentheses and take the derivative on the sine, and that derivative is cosine. So again, outside first and then inside, and we can clean this up, cosine x over two square roots of sine x. Let's try another example. f of x is equal to one over the square root of x squared minus three. Well, again, the outside is to the negative one-half power, and inside is x squared minus three. So if we do f prime of x on this one, we do the outside first, which is negative one-half, x squared minus three to the negative three-halves, and then we go inside to our g of x function and take the derivative on that, which is two x, because the three, of course, its derivative is zero. Clean this up, and we have negative x, and we can keep the x squared minus three to the negative three-halves in the numerator or put it in the denominator. It doesn't matter usually which way you finish these off. Let's go to another example. This one says y is equal to two to the two x squared power plus one quantity to the fifth. Again, the outside is to the fifth power. The inside is the two to the two x squared plus one. So y prime is equal to five power rule again, two to the two x squared plus one to the fourth. Go inside, finish off our chain rule, take the derivative of two to the two x squared, which is two to the two x squared ln of two. Now we have another chain rule going, and the fact that we have to take the derivative of two x squared, which is four x. And, of course, the derivative on the one is zero. So we did more or less a double chain rule, one inside the other. Once we got to the two x squared, we had to take the derivative of that. So cleaning this up, we get four times five is twenty x, two to the two x squared ln of two, times two to the two x squared plus one, all to the fourth power. A little more complicated than the others because we had to do the chain rule twice. And the more familiar you get to doing this without putting u's in, and if you notice I have not showed you substitution in this at all, I've just done it as the chain rule is peeling off the different parts of the composite functions. Let's try an example that uses product rule as well as your chain rule. So if we want the prime on this, it's y prime equal. Now we have to use product rule, so it's going to be the x times the derivative of sine of one over x. Now on the sine of one over x, the outside is the sine and the inside is one over x. So we first take the derivative of sine, which is cosine, of one over x. Then we go inside and take the derivative of one over x, which is negative one over x squared. Again, double chain rule in this one. And of course, end up with the product rule again, plus the sine of one over x times the derivative of x, which is one. And cleaning this up, we can see we can reduce a little bit here. So we will have negative cosine of one over x over x plus sine of one over x. A little more complicated because we have product rule in there, but again peel, peel, peel away. Here's another example with product rule. We have e to the sine of x squared times ln of x cubed. So if we want this derivative, again we use product rule on the two different functions. We will say e to the sine of x squared. And then take the derivative of ln of x cubed, which is one over x cubed times three x squared. Add to that ln of x cubed times the derivative of e to the sine of x squared times the derivative of sine of x squared, which is cosine of x squared times the derivative of x squared, which is two x. So we had to do a lot of peeling to get this particular derivative. Remember, we did first the e function because that was the outside one. Once that was stripped away, we did the derivative on the sine, got that stripped away, and then finally did the derivative on x squared, which became our two x. And if you notice again, it was e to the sine of x squared. Not e to the x or anything simple. No, we took the sine of x squared fully. And when we got to the cosine part, we said x squared again. And until we got to the x squared and actually took its derivative, we kept it in our function. So let's see how we can clean this up. Well, we see that this one can be reduced and just leave it x in that denominator. And we can factor out an e to the sine x squared. And what we have left is 3 over x plus 2x ln of x cubed cosine x squared. And always factor out to clean up for your final answer. Our last problem will be a quotient rule problem. It will be y equals x cubed minus 1 over cosine of x squared. So we will have to use our quotient rule as well as our chain rule as we do this problem. So y prime will equal square the denominator. Then we have the denominator cosine of x squared times the derivative of the numerator, which is in this case 3x squared. And then we're going to minus the numerator and take the derivative of the denominator. So the cosine of x squared, we first take the derivative of cosine, which is negative sine of x squared. We are going to multiply that by the derivative of the x squared, which is 2x. Cleaning up a little bit, we can factor out an x. And then we will have 3x cosine of x squared plus x cubed minus 1 sine of x squared. And all of that is multiplied by a 2 over cosine of x squared squared. We could write that as cosine squared x squared. And we can multiply through by this too, but it really isn't important for us because there's no way we can factor out anything else. So this gives us the final problem that we have on product rule, quotient rule, chain rule, and very, very important topic in dealing with calculus. This concludes your lesson on chain rule.