 Let's see if we can generalize this process of factoring by grouping. So let's try to factor by grouping, if possible, x squared plus 4x plus 3x plus 12. So again, we'll split the terms into two sets. And again, no need to be fancy about this. We'll take the first two terms in one set and the second two terms in the other set. And we'll try to factor both sets. So x squared plus 4x, both terms have a common factor of x. So we can remove that common factor and get x times x plus 4. In the second set of terms, 3x plus 12, both terms have a common factor of 3. And so we can remove that common factor to get a factorization 3 times x plus 4. And so in our expression, both terms have a common factor of x plus 4. And so we can remove that common factor and we had an x, we still have an x, we had a plus 3, we still have a plus 3, and we get our factorization. Now one of the peculiar features of mathematics is that sometimes a simpler problem is actually harder. And in this case, if our polynomial has four terms, then we can break it into two sets of two terms. So if our polynomial was x cubed minus 3x squared plus 3x minus 9, it was useful to break it into x cubed minus 3x squared plus 3x minus 9. Or if we were trying to factor x squared y plus xy plus 3x plus 3, we were able to group the first two and group the last two. For x cubed plus 15x squared minus 4x minus 20, we group the first two, we group the last two. For x squared plus 4x plus 3x plus 12, we group the first two, group the last two. But if our polynomial only has three terms, we have to be clever about it. So let's say we want to factor by grouping, if possible, x squared plus 7x plus 12. And this time we can't group the first two terms because if we do that, we only have one term left. So we've got to be clever and we cleverly remember x squared plus 7x plus 12. Well, that's really x squared plus 4x plus 3x plus 12. And we've already figured out how to factor that. Well, let's try that on x squared plus 3x minus 10. So we cleverly remember that we've never solved this problem before. And that means we can't remember what the solution is. We'll have to figure it out. The key here is that we want to rewrite 3x, so it is the sum or difference of two terms. And that'll give us a total of four terms that we can split into two groups of two. The problem is this. The only way to do this is to try every possible set until we find something that works. However, we have no guarantee that any set will work. And what it comes down to is this. All methods of factoring require trial and error. You must try all possible combinations. And there's no guarantee any set will work. Well, we can assume at the very least that if the problem says to factor by grouping, it is actually possible because it would be unfair to ask you to do something that was actually impossible. So let's try to find groups. And the idea is that we want to find 3x as a sum or difference of things. So arithmetic is bookkeeping. Algebra is generalized arithmetic. We had an x squared. We still have an x squared. We had a minus 10. We still have a minus 10. We had a 3x. And we want things that will add or subtract a 3x. So maybe x plus 2x will work. And we'll group the first two and group the last two. Now what we need to do is we need to see if these two terms factor. So x squared plus x does factor as x times x plus 1. 2x minus 10 also factors as 2 times x minus 5. So it factored the individual groups. A useful thing to remember, however, anytime you deal with factoring is that a factor only matters if it's a common factor. So while we have a bunch of factors here, none of them are in common, so this doesn't work as a path to factorization. Well, let's try it again. We had an x squared. We still have an x squared. We had a minus 10. We still have a minus 10. We had a 3x. We want something that's going to add or subtract a 3x. So how about 2x plus x? We'll group the first two and group the last two. So now our second set of terms, x minus 10, that doesn't factor at all. Our first set of terms, well, there is a common factor of x that we can remove. But again, a factor only matters if it's a common factor, and all of the factors here are different. Let's try again. Since a kind and gentle math teacher would never give you a problem that requires more than three attempts to solve, we know that our third time has to work. Or maybe not, because we don't know that our math teacher is kind and gentle. But let's try it out. We have our x squared minus 10. Let's split our 3x into 3x plus 0x and group our terms. And the thing to recognize here is that because this is a 0x, we haven't really split our 3x up into two terms. So we're not even going to bother to try to see if we can find a common factor here. How about 4x plus minus x? So x squared plus 4x factors as x times x plus 4. Let's be clever here. Remember that a factor only matters if it's a common factor. What we hope is that minus x minus 10 is going to be x plus 4 times something, but it can't be. So we know that this won't work either. Let's try x squared plus 5x minus 2x minus 10. Our first two terms have a common factor of x, so we'll remove it. Remember that a factor only matters if it's a common factor. So I want to know if my second two terms can be written as x plus 5 times something. And if we stare at this, we realize that we can. We can write it as minus 2 times x plus 5. So our second two terms factor. And so now both of my terms have a common factor of x plus 5. We'll remove it. We had an x before. We still have an x. We had a plus minus 2 before. We still have a plus minus 2. And let's write that plus minus 2 as x minus 2.