Now it's time to talk about the product rule. Our goal in this section is to find the derivative of a product of functions. It is the rookie move to say, well, it worked for addition or we just take each one, do them separately, so I guess the naive approach wouldn't just be the product of both. You can easily see that that is no, so let's see that two ways. Let's imagine I want the derivative of x^5. Now, we know by the power rule that this is 5x^4. Let's break this up in a product for a second. Imagine I broke this up into x cubed times x squared. But let's pretend for a second, we're trying to figure this out, I want to know what this is, I'm going to put it in red. I'm going to put it in red is like, what if we did this? Take the derivative of each piece. What if I said, you know what? This is probably the derivative of the first thing times the derivative of the second thing. Imagine it just was that simple, life was that simple, if calculus were that simple. Now here we go. I'm keeping it in red so that you know this is super, not true. But let's take the derivative each one and see that for ourselves. The derivative of x cubed is 3x squared, and the derivative of x squared is 2x. Remember if this were the rule, if I could just bring the derivative in both pieces, then I should get 5x to the fourth, because we know that 5x to the fourth is the derivative that we're looking for of 5x via the power rule. But if I put these things together, what happens when you multiply 3x squared times 2x, you get 6x cubed. Do we all agree that 5x to the fourth is not the same or so? This is not the rule for a product. Again, because quotients are just multiplication by the reciprocal, we're going to need to have a new rule for products and a new rule for quotient and that is our goal. Come up with this rule. Let's see what's going on as we go through. Let's find out what it is. How to come up with this formula, it's amazing to watch this happen. We're going to define a new function h of x to be the product of the two functions whose derivative we would like, so f times, and we're after h prime of x. Let's go through limit definition and see if we can find this. The limit as little h goes to zero, I'm using little h as a variable in a function, but we'll swap that out in a second so it won't be confusing of h of x plus the variable h minus h of x. Don't get confused with the variable or the function versus h going to zero. Let's in fact, to avoid that confusion, let's change that right now and put back f and g. It's the limit as h goes to 0 of f of x plus h, times g of x plus h, minus the product, all over h. Straight application of the functions, the product that we're looking for. Nothing really too exciting there to talk about. But here comes a weird magical piece that is once again, one of these non-obvious steps that you just have to trigger head out and say, very impressive to the first guys who did this, and then you can see how clever they are to be able to move these things. I'm going to rewrite what I have and just like with conjugate trickery, multiply by 1 and not change the piece. I'm going to do something crazy and I'm going to add 0. Hopefully you agree that by adding 0, I don't change the expression, but I'm going to not write just plus 0, I'm going to write it in a weird way. It's a little unexpected. I'm going to write it as f of x times g of x plus h, just added something, so I should take it away. I'm going to actually make this zero, so I'm going to add and subtract the same thing. But you agree if you add and subtract same thing, you're just adding 0 and why would you do that? Well, because I can, it's not illegal. It's fancy, so I'm just going to remind you that these two terms over here, this is zero and this is the magic stuff, this is the cool step, makes this all work. How would you do that? That's not immediately obvious, but trust me, bear with me, it's going to work. See why we would do this. What I want to do is break this limit up into two pieces and reorder some terms. I'm going to take the first term I added, f of x, g of x plus h, and I'm going to pair that with the middle term. I'm going to switch the order though , you'll see why in a second. I'm going to grab the two middle terms and put them over h, and then I'm also going to grab the two terms on the ends and put them over h as well. Though I'm going to grab the first term, although I'm going to write the expressions backwards. I'm going to write the expressions better. This is the first term, f of x plus h, g of x plus h, minus the second term, g of x plus h and fx. You may have seen something like this before you group by like terms. If you noticed, I grouped the first, everything that got together, they both had an f of x in it. Second terms, they all have g of x plus h. That allows me to factor and actually, because it's the limit as h goes to zero, and there's no h in the f of x, I can actually just bring that all the way outside the limit and I'll have f of x times the limit as h goes to 0, g of x plus h, minus g of x all over h and for all the same reasons, I'm going to well, I can't quite bring it out, but I'm going to factor out at least inside the limit to this g. Of h plus x. Both have a common term. Let's do that. Then I'm going to regroup f of x plus h minus f of x and all over h. Now you can see why one would do such a thing. F of x times, what is, limitation of zero, g of x plus h plus. We've done this 100 times. That's the derivative of g plus, now watch this. As I take the limit as h goes to 0, this first term becomes g of x and then I have the limit as h goes to 0 of the difference quotient of f. That is exactly f'. This is my rule. It's slightly amazing how this works. Now I'll never ask you to do this on a test or I'll never likes proved to me. I'm only going to have you learn this, memorize it, use it to find derivatives. I want to just see how this happens because it's such a trend, it's such a common thing in calculus to add or subtract 0 or to multiply by 1, but a fancy one and a cool one that to do this and it's just not obvious and it's really, I'd just like to show you guys. Let's use it. Let me put the cleaned up version over here and we'll do it one more time. If I have a product f times g becomes f. This highlights the first times the derivative of the second plus the second times the derivative of first. A little hint, use this thing. Don't try to memorize the letters. Don't say f times g' plus g times f'. Because then if I give you a function called S or T or H, it messes you up. I like to say first times the derivative of second plus second times of the first to see if you've seen this before or memorize it backwards. It doesn't matter because it's a plus, but don't get hung up on the letters because of course that can change. Your rule, add it to your rule book, and let's do an example. Let's try to combine some stuff here. If I have the function, let's say x squared times 2^x. There we go. It's a product so I should use the appropriately called product rule to go. It goes first times the derivative of the second functions, derivative 2x plus the second function times the derivative of the first function. Each one of these derivatives, I know, I have the rules to do this. X squared times exponential function, so repeat log the base plus 2^x times 2x. Let's do one more and we'll keep this video short. Let's do a medium difficulty question. Let's do x times x plus 2 squared. There's a product here and the catch, this one is that I don't know how to do x plus 2 squared. It's a product, so it's like first times the double, maybe I do, but just not in that form. X plus 2 first times derivative of the second. Notice I sing a little song as I do it. This is how I help remember stuff. Say, it's easy to remember my stuff if it's in a song. I have a terrible voice, oh sorry. First times derivative of the second plus the second function times the derivative of the first function, so ddx of x. The only catch, the only trick here that you can do is foil this thing. Remember, this is x squared plus 2x plus 4. I can take a derivative using the power rule there and you get 2x plus 4 and then you have x plus 2 squared times 1. I'm going to leave the answer like this. I know I could foil this out and do more algebra and clean it up, but I don't want to because there's no reason to, that's perfectly fine answer. There it is. It's a little messy, yeah, it is, but it is what it is. It's some function, I found the derivative. If I show the product rule, I don't need to clean it up. There's a time and a place we'll clean it up and you'll see that when you learn when to do it later. But if you're just asked to find the derivative, you can give back the answer like this. Just one other thing to notice, there's nothing stopping you from rewriting the question in perhaps an easier way. Here, the algebra was not done for you and I made the calculus a little messy. There's nothing stopping you from saying, well, I know what x plus 2 squared is and so, why don't I just multiply that by x? I can combine this whole thing and do algebra first to get x cubed plus 4x squared plus 4x. If you work out the foil and multiply by x, you get x cubed plus 4x squared plus 4x, and then take a derivative. I don't need the product rule anymore. I've completely just removed the need for the product rule, and you'll get 3x squared plus 8x plus 4. You can check if you actually cleaned up the expression that we got originally, you'll get 3x squared plus 8x plus 4. I encourage you, if you want to simplify something before we take a derivative, the simpler you start with, the easier the derivative will be to find. We'll do more examples and we'll look at the quotient rule in the next video.