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.

# Completing the square

Some quadratic expressions can be factored as perfect squares. For example, x²+6x+9=(x+3)². However, even if an expression isn't a perfect square, we can turn it into one by adding a constant number. For example, x²+6x+5 isn't a perfect square, but if we add 4 we get (x+3)². This, in essence, is the method of *completing the square*. Created by Sal Khan and CK-12 Foundation.

## Want to join the conversation?

• That wasn't very clear, may you please do another video about that?
• You don´t need another video because I´m about to explain it to you! Say you have the equation 3x^2-6x+8=23. To complete the square, first, you want to get the constant (c) on one side of the equation, and the variable(s) on the other side. To do this, you will subtract 8 from both sides to get 3x^2-6x=15. Next, you want to get rid of the coefficient before x^2 (a) because it won´t always be a perfect square. Because there is a 3 in front of x^2, you will divide both sides by 3 to get x^2-2x=5. Next, you want to add a value to the variable side so that when you factor that side, you will have a perfect square. In this case, you will add 1 because it perfectly factors out into (x-1)^2. Because you´re taking this value away from the constant, you will add it to the other side of the equation (this might not make sense at first, but if the constant were on the variable side, you would be subtracting). This will all give you the equation (x-1)^2=16. Next, you want to take the square root from both sides so that x-1 is equal to the positive or negative square root of 16 (positive or negative 4). Finally, you add 1 to both sides, taking into account that 4 could be positive OR negative. Therefore, x = -3 or 5. Situations could vary, but this is the basic idea behind the procedure. I hope this helps! :)
• Can someone please post the link to the "Last video" of which Sal speaks?
• I don't know about you guys, but I'm more confused now than I was when I started the video! Could someone please explain to me in detail how all this works?
• 5 years later...
I don't know about others, but I'm more confused now than when I started the video as well! Could someone at least show all the steps or work that is missing for understanding this kind of high-level education problems?
• Between to , May i understand why a=-2. i thought it would be 2 instead since were equating -4x to -2ax.
• I think Sal made a mistake. But 2^2 and (-2)^2 are both 4, so the result was correct.
• At , I am confused about where the (x-a)^2 came from and why that is equal to x^2-4x=5
Could you explain this?
Now x^2 - 4x = 5
x^2 - 4x + (something) = 5 + something
I want to factorise the left side of the equal sign, so I have to find a value for (something) which would allow me to factorise the left-hand side of the equation.
If (something)=4
x^2 - 4x + 4 = 5 + 4
Notice that now I could factorise the left hand side into (x - 2)^2
(x-2)^2 = 9
x-2 = root of 9 = + or - 3
x = +3+2 or -3+2
x = +5 or -1.
You want x^2 - 4x + (something) to be equal to (x-a)^2.
where a is half the coefficient of x(the number before the x), as long a there is no coefficient of x^2. Here a = 2.
A shorter way to do this is:
x^2 - 4x = 5
(x - (4/2))^2 - (4/2)^2 = 5
(x-2)^2 - 4 = 5 and so on. But remember, you only halve the coefficient of x and put it into the brackets only if there is no number before x^2 (coefficient of x^2). If it is there then you have to divide the whole equation first by the coefficient and then halve the coefficient of x and put it into the brackets.
Sal uses (x - a)^2 simply to tell this is the format of the factorised form of :
x^2 -4x +? = (x - a)^2, where a = 2 (4 divided by two).
Sorry for the large number of words used to answer your question.
• He is missing a lot of steps in his work.
• Why is it called 'completing the square?'
• It is called completing the square because once you have to "complete" a perfect square to solve it, as in all of the steps are for you to end up with a perfect square to apply a square root on it.
• Why did he say that we needed a a number times 2 to equal -3 (it was around )?

• isn't a perfect square trinomial

(ax-b)^2 = (ax)^2+2abx+b^2?

I get a bit confused as to why, when using the completing the square to derive the quadratic formula we only divide by 2, whit out also dividing by a.

but we do, right? we do it at the beginning.

ax^2+bx+c = 0

1/a*(ax^2+bx+c) = (0)1/a

x^2+bx/a + (b/2a)^2 = -x/a - (bx/2a)^2

In that step, we divide the second term by 2a to isolate b, and raise it to a second power.

I'm just trying to confirm things, not sure if I’m wrong
• I was following the quadratic formula Proof video, some expressions in my question were written wrong, so here's the correction.

ax^2+bx+c = 0

We divide by ' a ' both sides
(a/a)x^2 + (b/a)x + (c/a) = 0/a

We move the c element to the right hand side
and we add the missing expression to both sides to form a perfect square.

x^2 + (b/a)x + (b/(2a))^2 = -c/a + (b/(2a))^2

At this point we complete the square.

I was trying to ask if my thinking behind how we come up whit (b/(2a))^2 was correct.

A perfect square trinomial is

(cx+d)^2 = (cx)^2+2cdx+d^2

(I’m not using ‘a’ and ‘b’ to not mix up the variables whit the first equation of this comment)
So if we want to find the third term, we just need to take the second term, ignore the factor x, and divide by '2c', so:

(2cd/(2c))^2 = d^2 This is what I meant by "isolating b": find the missing third term using the second.

So, the relationship between deriving the quadratic formula, and completing the square to find the third element is this:

b = 2cd <- I didn't get this relationship at first

b/(2a) = (2cd)/(2c)

And finally:

( b/(2a) )^2 = d^2

But I think it's all clear now, correct me if there's something wrong :)
• Around , Sal divides the quadratic equation by 5. This process makes the coefficient of x^2 equal to 1. My question is does the coefficient of x^2 need to be 1 to complete the square.
• no it doesn't have to.

for example; 2x^2+18x+16
one can factor this by..
(x+8)(2x+2)

but if you divide everthing by 2,
you can make 2x^2+18x+16 to x^2+9x+8 then you can factor this to
(x+8)(x+1)

you see, this is the same as (x+8)(2x+1) but simpler.

so to answer your question; it doesn't matter, but is's the matter of which one is simpler

hope this helps :)
(1 vote)