If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Solve by completing the square: Integer solutions

We can use the strategy of completing the square to solve quadratic equations. If the solutions are integers, we can solve by factoring as well. Created by Sal Khan.

Want to join the conversation?

Video transcript

- [Instructor] So we're given this equation here. And what I want you to do is pause this video and see if you can solve it. What x values satisfy the equation? All right, now let's work through this together. So one technique could be just, let's just try to complete the square here on the left-hand side. So to do that, let me write it this way, x squared minus eight x. And then I have, I'll write the plus one out here, is equal to 85. Now if I wanna complete the square, I just have to think, "What can I add to both sides of this equation "that could make this part of the left-hand expression "a perfect square?" Well, if I look at this negative eight coefficient on the first-degree term, I could say, "Okay, let me take half of negative eight." That would be negative four. And then, negative four squared is going to be positive 16. So I'm gonna add positive 16 on the left-hand side. And if I want, I could then subtract a 16 from the left-hand side. Or I could add a 16 on the right-hand side. Notice, I've just done the same thing to both sides of this equation. And why was that useful? Well, now what I've just put in parentheses is a perfect square. This is the same thing as x minus four squared. It was by design. We looked at that negative eight. Half of that is negative four. You square it, you get 16. And you can verify, x minus four times x minus four is, indeed, equal to this. And then we have plus one is going to be equal to, what's 85 plus 16? That is 101. And now we wanna get rid of this one on the left-hand side. And the easiest way we can do that is subtract one from both sides. That way we'll just isolate that x minus four squared. And we are left with x minus four squared. Four squared, these cancel out, is going to be equal to 100. Now if something squared is equal to 100, that means that the something is equal to the positive or the negative square root of a hundred. Or that that something, x minus four, is equal to positive or negative 10. Positive or negative 10. All I did is took the plus or minus square root of a hundred. And this makes sense. If I took positive 10 squared, I'll get a hundred. If I take negative 10 squared, I get a hundred. So x minus four could be either one of those. And now I just add four to both sides of the equation. And then what do I get? I get x is equal to four plus or minus 10. Or another way of thinking about it, I could write it as x is equal to, four plus 10 is 14. And then four minus 10 is equal to negative six. So these are two ways to solve it. But there's other ways to solve this equation. We could, right from the get-go, try to subtract 85 from both sides. Some people feel more comfortable solving quadratics if they have that quadratic expression be equal to zero. And if you did that, you would get x squared minus eight x minus 84 is equal to zero. All I did is I subtracted 85 from both sides of this equation to get this right over here. Now this one we can approach in two different ways. We can complete the square again. Or we could just try to factor. If we complete the square, we're going to see something very similar to this. Actually, let me just do that really fast. If I look at this part, right over there, I could say x squared minus eight x. And then once again, half of negative eight is negative four. That squared is plus 16. And then I'd have minus 84. So let me do that in that blue color so we can keep track. Minus 84. And then if I added 16 on the left-hand side, I could either add that to the right-hand side so both sides have 16 added to it. Or if I wanna maintain the equality, I could just subtract 16 from the left-hand side. So I've added 16, subtracted 16. I haven't changed the left-hand side's value. And then that would be equal to zero. This part right over here, this is x minus four squared. This part right over here is minus 100 is equal to zero. And then you add a hundred to both sides of this and you get exactly this step right over here. Now another way that we could've approached it without completing the square. We could've said x squared minus eight x minus 84 is equal to zero. And think about what two numbers if I multiply them I get negative 84. So they'd have to have different signs, since when I take their product I get a negative number. And when I add them together I get negative eight. And there we could just look at the factorization of negative 84, of 84 generally. It could be two times, let's just think about 84. 84 could be two times 42. And obviously, one of them would have to be negative, one of them would have to be positive in order to get to negative 84. But the difference between these two numbers, if one was positive and one was negative is a lot more than eight. So that doesn't work. So let's try, let's see, I'll do a few in my head. Three times 28. But still that difference is way more than eight. Four times, four times, let's see, (mumbles). Four times 21, no, that difference between four and 21 is still larger than eight. Let's see, five doesn't go into it. Six times 14, that's interesting now. Okay, so let's think about this. So six times 14 is equal to 84. One of them has to be negative. And since when we take the sum of the two numbers, we get a negative number, that means the larger one is negative. So let's see, six times negative 14 is negative 84. Six plus negative 14 is, indeed, equal to negative eight. So we can factor this as x plus six times x minus 14 is equal to zero. And so the product of those two things is equal to zero. That means if either of them is equal to zero, that would make the entire expression equal to zero. So we could say x plus six is equal to zero. Or x minus 14 is equal to zero. Subtract six from both sides here. We get x is equal to negative six. Or add 14 to both sides here. Or x is equal to 14. Exactly what we got up here.