 In this video, I want to practice simplifying difference quotients that involve polynomial expressions. It's mentioned that when you deal with polynomials, you'd have to sometimes foil things out. And when you foil, you're always going to have a binomial, you're going to have something like x plus h raised to, like, say, like the fourth power. Use the binomial theorem to help you out in those situations, it makes it a whole lot easier. So what if we start off with a quadratic, like f of x equals 2x squared minus 5x plus 1? When you evaluate this difference quotient, I'm going to call it delta y over delta x right here, because it's an average rate of change. You're going to take f of x plus h here. What that means is everywhere you see an x, you're going to replace it with an x plus h. Honestly, when I think of functions, I like to think of them the following way. Instead of having the variable x, I actually like to have it as like an empty box, right? You have f of blank, right? What does that mean? f of blank is 2 times blank squared minus 5 times blank plus 1. And then inside that blank you can put something. So for f of x, we just put an x inside of the blank, alright? But for f of x plus h, we put an x plus h in each of the blanks. And that's the only difference between them, okay? And so let's put that into practice here. So f of x plus h would look like, I'm going to put a big bracket around all of it, you're going to get 2 times x plus h, quantity squared, minus 5 times x plus h plus 1. And then we're going to subtract from it, f of x, for which you just put an x in each of the blanks, 2x squared minus 5x plus 1. Like so, and this all sits above h. So now we need to expand the numerators so we can combine like terms. That means we're going to have to foil some things out, so like the x plus h squared is foiled. You might not need the binomial theorem to do x plus h squared because that's, you probably have a lot of practice with it. When you multiply it out, you're going to get x squared plus 2x plus h squared. Be aware that x plus h quantity squared is not x squared plus h squared, there is a middle term, the 2xh there. Distribute the negative 5, we're going to get negative 5x minus 5h plus 1 minus 2x squared minus 5x plus 1, like so. This is all sitting above h. I'm also going to distribute this 2, right? I want to distribute the 2 throughout here. If we did that, we end up with instead times everything by 2, we're going to get a 2x squared plus a 4xh plus a 2h squared. You don't necessarily have to do that all at once, don't do too much, then you can handle. I just kind of took care of it right here, but now we're ready to combine some like terms. Everything in the f of x portion will cancel with something in the f of x plus h portion. It's just plain, I didn't have to go on an Easter icon right now. So I need a 2x squared, up here's a 2x squared, so they're going to cancel out. I need a negative 5x, up here's my negative 5x, they're going to cancel out. Why are they canceling? Because I'm subtracting them. And then you have a plus 1, that's going to cancel with a plus 1, so those are gone. And so you're going to notice what did not get canceled. We get a 4xh, we get a 2h squared, and we get a negative 5h. Everyone in the numerator who did not cancel, who survived this battle, is now divisible by h. Factor out the common divisor of h. This then gives us h times 4x plus 2h minus 5 all over h, like so. Now the h is canceled, like so. And so in the end we now see that the average rate of change, delta y over delta x, is equal to 4x plus 2h minus 5. And so then if we want to figure out what happens as h goes to 0, that is we want to calculate the instantaneous rate of change, dy over dx. This is when h goes to 0, you're going to get 4x plus 2 times 0 minus 5. This then becomes 4x minus 5. Let's do another example. This time, let's consider f of x to be 3x to the fourth. And we want to evaluate the difference quotient. OK, so in that situation, delta y over delta x, this is going to look like 3 times x plus h to the fourth minus 3x to the fourth all over h. And this is kind of a big power of x here. I would recommend the binomial theorem right here. So remember the binomial theorem. You're going to look at Pascal's triangle, the triangle formed by recursively adding a new row by adding the terms above it. So remember how we compute this. You're going to get like 1 plus 2, which is a 3. 3 plus 3 is a 6. 3 plus 1 is a 4. So since we're taking x to the fourth, we need the fourth power, x to the fourth. Right here, we need the fourth row. And that's going to be the one that has a 4 in it, right? So here's our fourth row. So the fourth row of Pascal's triangle will give you the coefficients of that expansion. So when I look at 3, I'm actually going to factor the 3 out here. Unless everything's divisible by 3, I'm going to take out the 3. That leaves behind x plus h to the fourth minus x to the fourth all over h. And then the coefficients of x plus h to the fourth as you multiply them out will look like the following. You're going to get 1 times x to the fourth. You're going to get 4 times x cubed h. You're going to get 6 times x squared h squared. You're going to get 4 times x h to the third. Scooch this over a little bit. And then you're going to get 1 times h to the fourth. And then we subtract from that x to the fourth, okay? And this all sits above h. So you'll notice here, we took the coefficients 1, 4, 6, 4, 1. But then the patterns of powers like the x's were decreasing, right? You had x to the fourth, x cubed, x squared, x to the first, x to the zero. You don't see x to the zero because that's a 1. But then the powers of h were increasing. You have h to the zero, h to the first, h squared, h cubed, h to the fourth. That's the binomial theorem there. So cancel out the terms that you can. You have an x to the fourth, which cancels with the x to the fourth. Great, so then what is left behind? You're going to get 3 times 4x cubed h plus 6x squared h squared plus 4x h cubed. And then there's also a h to the fourth right there. This all sits above h. Notice that everyone in the denominator, excuse me, everyone in the numerator is now divisible h. You could factor it out. So you get 3 times h times 4x cubed plus 6x squared h plus 4x h squared plus h cubed. This all sits above h, for which then that h then cancels out. And so then what do we have here? We have that delta y, let's switch it back to white, delta y over delta x. This is going to equal 3 times 4x cubed. I'm going to show you the three out by now, why not? So you're going to get 12x cubed plus 18x squared h plus 12x h squared plus 3h cubed. That gives you the average rate of change. If you're interested in the instantaneous rate of change, this is when you get dy over dx and this is when h goes to zero. If h goes to zero, then all these things are going to disappear and you're left with just 12x cubed. That is the derivative of 3x to the fourth.