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 where we just take each one and do them separately. I guess the naive approach would be it wouldn't just be the product of both. You can easily see that that is no, so let's see that two ways. So let's imagine I want the derivative of x to the fifth. Now, we know by the power rule that this is 5x to the fourth. So let's break this up into a product for a second. So imagine I broke this up into x cubed times x squared. So 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. So I'm going to put it in red as like, what if we did this? So 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, as if life was that simple, as if calculus were that simple. So here we go. I'm keeping it in red so that you know this is super not true. But let's take the derivative of each one and see that for ourselves. So 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, 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 as 5x to the fourth? 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 here today. So let's come up with this rule, let's see what's going on as we go through this. Let's find out what it is. How to come with this formula, it's amazing to watch this happen. So 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 g. We're after h prime of x. Let's go through limit definition and see if we can find this. This'll be 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, h of x plus the variable h minus h of x. So don't get confused with the variable of the function versus h going to zero. Let's, in fact, avoid that confusion. Let's change that right now and put back f and g. So it's the limit as h goes to zero 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 this 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. Just like with conjugate trick, we multiply by one and not change the piece. I'm going to do something crazy and I'm going to add zero. Hopefully, you agree that by adding zero I don't change the expression. But I'm going to not write just plus zero, 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. Now, I just added something so I should take it away if I'm going to actually make this zero. So I'm going to add and subtract the same thing. Hopefully, you agree if you add and subtract same thing, you're just adding zero. 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 this thing, these two terms over here, this is zero, and this is the magic step. This is the cool step that makes this all work. Why would you do that? That's not immediately obvious, but trust me, bear with me, it's going to work. Let's go back and see why we would do this. What I want to do is break this limit up into two pieces. I'm going to 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. So 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. So 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. So there's the first term, f of x plus g of x plus h minus the second term, g of x plus h and f of x. You may have seen something like this before where you group by like terms. If you notice, everything I got together they both had an f of x in it. The second terms, they all have g of x plus h. That allows me to factor. Actually, because it's the limit as h goes to zero, and there is 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 zero of g of x plus h minus g of x, all over h. For all the same reasons I'm going to factor out at least inside the limit, this g of h plus x. So they both have their 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 this? Limit of h equals to zero g of x plus h, we've done this 100 times. That's the derivative of g plus, now watch this, as I take the limit h equals 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 prime. This is my rule for the quotient rule. It's slightly amazing how this works. Now, I'll never ask you to do this on a test or I'll never like prove to me. I'm only going to have you learn this, memorize it, use it to find derivatives. But I wanted you to see how this happens because it's such a trend, it's such a common thing in calculus to add or subtract zero or to multiply by one but a cool one to do this and it's just not obvious and I'd just like to show you guys. So let's use it, let me put the cleaned-up version over here and we'll do it one more time. So if I have a product f times g, this becomes f, as I like to say, first times the derivative of the second plus the second times the derivative first. Just a little hint as you use this thing. Don't try to memorize the letters. Don't say f times g prime plus g times f prime. Because then if I give you a function called s, or t, or h, it messes you up. So I like to say first times the derivative of the second, plus second times of the first. Obviously, 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. So there's 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. Here we go. It's a product, so I should use the appropriately called product rule. How does it go? It goes first times the derivative of the second function, derivative 2_x, 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. So x squared times an exponential function. So repeat log to the base plus 2_x times x squared. You can clean this up. There is stuff to factor out if you want to. For example, both have an x squared times 2_x, and you can write it as ln_2 plus 1, either is perfectly fine. Normally in a calculus course, we don't care if you algebraically clean stuff up, but I know if you're checking answers in the back of the book or something, they'll do something like this. But on a test, I don't recommend simplifying unless you absolutely have to administer some benefit to it. If we're just doing it to present the answer in a different format, there really is no benefit to it. Let's do one more, and we'll keep this video short, and let's do maybe like a medium difficulty question. Let's do x times x plus 2 squared. So there's a product here. The catch, this one is that I don't know how to do x plus 2 squared. So 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. It's how I help remember stuff. They say it's easier to memorize stuff if it's an a song. First, you have a terrible voice, 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. So remember this is x squared plus 2x plus 4x, plus four. So 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. There's no reason to, that's perfectly fine answer. There it is. You say that's a little messy. Yeah, 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 to 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 get 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 that 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 so I can combine this whole thing do algebra first to get x cubed plus 4x squared plus 4x. So if you work out the foil and multiply by x, you get x cubed plus 4X squared plus four x and then take a derivative, I don't need the product rule anymore. I've completely just remove 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 3a squared plus 8x plus four. 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. All right, we'll do more examples and we'll look at the quotient rule in the next video.