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.

# Worked example: Rewriting & solving equations by completing the square

Sal solves x²-2x-8=0 by rewriting the equation as (x-1)²-9=0 (which is done by completing the square!).

## Want to join the conversation?

• At , Can we use the identity (a^2 - b^2) = (a-b)(a+b) for the terms (x-1)^2 and 9?
Can't we just factor these terms as (x - 4)(x + 2)?
• Yes but that may not work out for every question
• hi David, i'm having trouble understanding equations with fractions like 50-1/2x^2=23 and i don't know which way to solve it.
• You can eliminate the fraction by multiply by 2. Since the problem will be easier to solve if x^2 is positve, change that to multiply by -2 to change the signs at the sam time.
Your new equation is: -100+x^2 = -46

I would use square root method to solve.
-- Add 100 to both sides
-- Take the square root of both sides.

Hope this helps.
• At about , what's the point of writing x²-2x-8=0 in the form, (x+a)²+b?
Also- isn't -8 in the equation already a²?? Confusion..
• This is called vertex form, and as the name implied it very easily lets you tell the vertex (the max or min of a parabola.) Specifically it is (-a, b)

it is also much easier to get the 0s which would be +/- sqrt(-b) - a. not as easy as factored form of course.

When it comes to graphing, vertex form is the easiest by far to recognize transformations. Specifically you want want it written as A(B(x-C))^2 + D Where A is the vertical stetch, B is the horizontal shrink, C is the horizontal shift and D is the vertical shift. You could also Not have B if you factor it out like this.

A(B(x-C))^2 + D
AB^2(x-C)^2 + D
Then you would just have AB^2 as one component which would account for both vertical and horizontal stretches and shrinks.

I hope this all made sense, if not though just let me know what you didn't understand and I can explain.

Also the -8 is the constant in x²-2x-8=0, so it is c. Then there isn't a -8 in the vertex form, (x-1)² - 9 = 0

And (x-1)² - 9 tells us there are no stretches or shrinks, the graph is just the normal x² graph moved right 1 and down 9 units.

Again, let me know if you have any questions about my answer.
• I'm probably getting ahead of myself here (thinking back over the many years I can almost remember parts to my answer), but why - in some videos - does Sal say "X=a AND X=b," while in others he uses the verbiage "or."

In other words, he verbalizes the solutions in these two ways:
1) X=a AND X=b
2) X=a OR X=b

I can't imagine it can be "and," in addition to "or." I presume "or" is restricted only by real-life scenarios (where a negative solution wouldn't make sense), but if this is the case -- aren't we implying that mathematics (as we currently understand it) isn't always correct?

Thanks for looking!
• For these purposes, either is okay because we are finding solutions, In words, it would be 'x is a and x is b' for and, and 'x is a or b' for or. I really prefer the or not just because it requires less words, The reason is if you ever get into set theory, these two words have a lot more meaning ( and means the union or intersection of two sets, or means the total elements of the two sets),
In real life scenarios, the or would not help because negative numbers that do not make sense to the problem would be called extraneous solutions, and would not show up as part of the answer, so the answer would just be x=a. This is also true when you get to Algebra II and start dividing polynomials such that any answer that would make the denominator zero would be extraneous. Merely interchanging language does not invalidate the process we use to get solutions.
• Couldn't this problem be solved by just doing this?
(x+2)(x-4)?

Thanks
(1 vote)
• Yes it could because the quadratic was factorable. But, not all quadratics are factorable. So, we need to learn other techniques. The video was trying to demonstrate how to complete the square which is one technique that works for all quadratics (factorable or not).
• can we not just add 8 to boat sides and change the xero to plus 8?
• Yes that is a good way of doing this to complete the square.
• Hello everyone!

Theoretically, can one complete the square of higher degree polynomials? I doubt so but would like to see what others think.
• If you could 'complete the square' for higher degree polynomials wouldn't it be called something different like completing the cube.
• Hi all,

So after struggeling with the exercise "Practise: Completing the square (intermediate)". I noticed an odd thing.

I'm not sure if I am correct, but when rewriting equations, the output for a given X, should stay the same right? Otherwise the rewritten equations wouldn't be the same, because the output is different.

I couldn't solve the following equation:
2x^2 -9X + 7 =

The hints suggested that you can solve it in the following way:

1: 2X^2-9X = -7
2: X^2 -(9/2)X = -(7/2)
3: X^2 -(9/2)X = -(7/2) + (81/16)
4: (X-9/4)^2 = 25/16

Let's pick an X value, for example X = 1.
I have rewritten equation 2 to have the 25/16 on the left hand side.

Equation 1: 2(1^2) -(9 x 1) + 7 = 0
Equation 2: (1-9/4)^2 -(25/16) != 0 but is equal to: 1.5625

Is there anyone who can explain why this is a valid solution?
(1 vote)
• There are several problems.

(1-9/4)^2 - 25/16
(-5/4)^2 - 25/16
25/16 - 25/16
0

Second, when you completed the square your step 3 shpuld look like

3: X^2 -(9/2)X + (81/16)= -(7/2) + (81/16)

because (x-9/4)^2 = x^2 - (9/2)x + 81/16

Third,since you divided by 2 in step 2, you need to multiply both sides by 2 in step 4 to get the completely correct answer. so 2(x-9/4)^2 = 25/8

Also setting x = 1 in this still is correct. But both 2(x-9/4)^2 = 25/8 and (X-9/4)^2 = 25/16 have the same roots

Let me know if you need any more help.
• I have this problem, but the steps are completely different from other completing the squares: x^2-8x-9y+52=0 then the next step subtracts 9y instead of 52. I don't know why: x^2-8x+52=9y ? After this the constant gets a value added instead of the 9y even though it is in the spot where the constant should be.
(x^2-8x+?)+52-?=9y Now the ? is being subtracted from 52 instead of adding?!
(x^2-8x+16)+52-16=9y
(x-4)^2+36=9y
/9 from all
and then the final is 1/9(x-4)^2+4=y why is it 1/9, why is the 1/9 separated from the (x-4)^2+4=y? Is 1/9 a in ax^2?
• Many of the examples on KhanAcademy have just a single variable. Your problem has 2 variables. You are completing the square to change the quadratic function into vertex form. You may find the examples at this link helpful: https://www.purplemath.com/modules/sqrvertx.htm

1) Why was 9y moved?
-- First, it starts to make the equation look more like vertex form: y = a (x - h)^2 + k. The "y" should be on the side opposite the x's.
-- You're completing the square for "x". So, moving 9y gets it out of the way.

2) (x^2-8x+?)+52-?=9y: The ? is being subtracted from 52 instead of adding?
-- If you are adding something to one side, you must somehow cancel it out to keep the equation in balance.
-- In this case the value will be added (inside the parentheses) and also subtracted on the outside. So, essentially, you're adding 0.
-- The alternative is to add the value to both sides of the equation. But, since you're trying to get vertex form, you want to try and keep "Y" by itself.

3) Why is the 1/9 separated from the (x-4)^2+4=y?
-- The entire equation was multiplied by 1/9. 36 *(1/9) became the 4. 9y *(1/9) became y. And (x-4)^2 * (1/9) became the 1/9 (x-4)^2. This part was not simplified because it would destroy all the work associated with completing the square. The 1/9 becomes the "a" value in vertex form.

Hope this helps.
• Why did Khan need to add 9 to both sides before taking the square?

(x-1)^2 - 9 = 0
(x-1)^2 = 9

Can't he just take the squre and then move +/-9 later?

Ex.
√(x-1)^2 - 9 = 0
x-1 +/-9 = 0
x = 1 +/-9

Can't we do something like this?
(1 vote)
• Sorry, that doesn't work.

To get from (x-1)^2 to just (x-1), you need to apply a square root. You are taking the square root of just a portion of the equation. So, your equation is not equivalent to the original equation.

Square roots work on factors, not terms. So, you also can't take the square root of (x-1)^2-9 since it has 2 terms. By moving the 9 to the opposite side, and then taking the square root of both sides, you have individual terms on each side that you can apply the square root and be able to simplify them into:
x-1 = +/-3.

Hope this helps.