MathemagiciansLibraryExplorationsDeep Dives
← Mathematics · Upper Secondary
MathematicsUpper Secondary

Solving quadratics by completing the square

U2 — Algebra Advancing › U2.2 — Quadratic EquationsLecture 4 of 4~2140 words

A thousand-year-old answer, half finished

The completing-the-square lecture told the story of al-Khwārizmī, the Baghdad scholar who wrote about solving equations around the year 820. His problem was: a square and ten of its roots make 39. In our notation, . He halved the 10 to get 5 and added to both sides, making . Since , he wrote , so .

That answer is correct. But it is only half of the answer. Try : . It works too. Al-Khwārizmī was thinking of real lengths and areas, where a negative side makes no sense, so he never looked for it. The missing answer was hiding in one small step: the square root.

This lecture turns completing the square into a full method for solving quadratic equations, the third method in this unit after factorising and the formula. It is the most transparent of the three. You see every step, and you get the vertex of the graph for free.

Undoing a square

Start with the simplest case. If , what is ? Most people say 3. But as well. A positive number has two square roots, one positive and one negative. So the full answer is or , written .

The same is true when a whole bracket is squared. If , then the bracket is a number whose square is 64. It could be 8, or it could be :

So or . Both of al-Khwārizmī's answers come out, as long as you keep both signs. That is it. That is the whole idea. Completing the square turns any quadratic equation into "a bracket squared equals a number", and the ± gives you both solutions at once.

Solving by completing the square

1. Complete the square, so the equation becomes .

2. Rearrange: .

3. Square root both sides, keeping both signs: .

4. Subtract : .

Worked Example 1 — The basic method

Solve . Give exact answers, then answers to 2 decimal places.

This does not factorise: the factor pairs of 2 are 1 and 2, which do not add to 6. Half of 6 is 3, and . We have , not , so take 9 away and add 2:

So or .

Check with the sum and product of the roots from the quadratic formula lecture. The roots should add to : . They should multiply to 2: . Both correct.

And the free extra: has its vertex at .

Look at what the picture says. The equation asks: where does the parabola reach a height of 7? It is symmetric about , so it reaches that height at two places, the same distance either side.

−7−6−5−4−3−2−101height 7√7√7−3 − √7−3 + √7y = (x + 3)²
Solving (x + 3)² = 7. The parabola y = (x + 3)² is symmetric about x = −3. It reaches height 7 at two points, √7 to the left and √7 to the right of −3: x = −3 − √7 ≈ −5.65 and x = −3 + √7 ≈ −0.35. The ± is this symmetry.

This is the same symmetry the quadratic formula lecture found: the two roots sit the same distance either side of the vertex. Completing the square shows it directly. Before going on, test the idea on a new equation.

Predict, then reveal — solving (x − 1)² = 16

Solve (x − 1)² = 16. Which answer is complete and correct?

The complete answer is x = 5 or x = −3. The bracket x − 1 can be 4 or −4. If x − 1 = 4, then x = 5. If x − 1 = −4, then x = −3. Check: (5 − 1)² = 16 and (−3 − 1)² = (−4)² = 16.

Notice that the two answers, 5 and −3, sit 4 either side of 1. The middle of the two solutions is always , the number that makes the bracket zero.

Worked Example 2 — A negative coefficient of x

Solve .

Half of is , so the bracket is . Take 25 away and add 18:

So or . The vertex of is . The bracket is , which is zero at , so the roots are centred on .

Now the promise from the completing-the-square lecture. It rewrote as and left the solving to this lecture. Here it is in two lines: , so , and . These are the roots the quadratic formula lecture found, about 0.24 and −4.24.

Two answers, one, or none

The last lecture showed that the discriminant decides how many roots there are. Completing the square shows the same thing in a form you can see. Every equation becomes for some number .

For example, becomes : one solution, . And becomes : no real solutions, because a square cannot be negative.

This is the discriminant in disguise. For , completing the square gives . With , that is . Dividing by 4 does not change the sign, so and are always positive, zero or negative together.

Stop and think

A student solves and writes , so or . What went wrong?

Show the answer

The student took the square root of 9, not of −9. Check : , not −9. No real number squared gives −9, so the equation has no real solutions. The right side being negative is the signal to stop. Never drop the minus sign to make a square root work.

When the x² coefficient is not 1

This is the hard part of the lecture. Read it slowly. The completing-the-square lecture rewrote expressions such as by taking out the 2 from the terms first. That works for equations too, but there is a trap in it. Step through the method below and read each reason.

Step through — solving 2x² − 8x + 3 = 0

Press Next to add one line. Read the reason before you go on. Line 4 is where most mistakes happen.

Each line of the solution, with the reason it is allowed.

  1. 2x² − 8x + 3 = 0: the equation.
  2. 2(x² − 4x) + 3 = 0: take out the factor 2 from the x terms only.
  3. 2[(x − 2)² − 4] + 3 = 0: complete the square inside: x² − 4x = (x − 2)² − 4.
  4. 2(x − 2)² − 8 + 3 = 0: the 2 multiplies both parts inside the square bracket, so −4 becomes −8.
  5. 2(x − 2)² − 5 = 0: collect the numbers.
  6. (x − 2)² = 5/2: add 5, then divide by 2.
  7. x − 2 = ±√(5/2): square root both sides, keeping both signs.
  8. x = 2 ± √(5/2) = (4 ± √10)/2: add 2; √(5/2) = √10/2.

There is a simpler route when you are solving an equation, not just rewriting an expression. An equation equal to zero can be divided through by any non-zero number without changing its solutions. So divide by 2 first:

The same line as before, with no factor to carry through and no −8 to remember. Both routes are correct. Use the first when you also want the completed-square form of itself, which is , with its vertex at . Use the second when you only need the solutions.

To tidy , multiply top and bottom inside the root by 2: . So , about 3.58 and 0.42.

Worked Example 3 — A negative x² coefficient

Solve .

Divide every term by , which does not change the solutions: . Now complete the square: , so .

So , about 4.24 and −0.24. Check in the original: .

Worked Example 4 — When is the ball 10 m up?

The discriminant lecture threw a ball upwards with height metres after seconds. It showed that the ball passes 15 m twice. When is it exactly 10 m high?

Set and rearrange: . Divide by 5: . Complete the square: , so .

So : about 0.59 s on the way up, and about 3.41 s on the way down. Both answers make sense here. The middle of the two times is s, the moment the ball is at the top. Completing the square shows that symmetry directly: the ball takes as long to fall from 20 m to 10 m as it took to rise from 10 m to 20 m.

Choosing a method

You now have three ways to solve a quadratic equation. They always give the same answers, because they are all the same algebra in different forms. The quadratic formula is completing the square done once, in general, with letters.

MethodBest whenWhat else you get
FactorisingSmall whole numbers, and D is a perfect squareThe factors
Completing the squarea = 1 (or easy to divide out) and b is evenThe vertex, and exact surd answers
Quadratic formulaAwkward numbers, or any time the others are slowA routine that always works

Exam questions often decide for you: "solve by completing the square" or "write in the form , and hence solve". The word "hence" means the completed form must be used.

Three classic mistakes

Trap 1 — Forgetting the ±

gives , not just . Dropping the minus loses half the answer.

Trap 2 — The factor outside the bracket

In , the 2 multiplies the −4 too, giving −8. Or avoid the problem: when solving, divide the whole equation by first.

Trap 3 — The sign of p

gives . The solutions are centred on , not on , because the bracket is zero when .

Try it yourself

Solve by completing the square. Give exact answers, then decimals to 2 decimal places where useful.

  1. Solve .

    Hint 1

    Half of is . Keep it as a fraction.

    Hint 2

    .

    Full answer

    , so . Then , so , about 3.30 and −0.30. Check: they add to 3 and multiply to , as the sum and product rule says.

  2. Solve , and state the vertex of .

    Hint 1

    To solve, divide every term by 3 first.

    Hint 2

    For the vertex, you need the form : take 3 out of the terms.

    Full answer

    Divide by 3: , so and . So , about 0.45 and −4.45. For the vertex: . The vertex is . (Dividing by 3 changes the expression, but not the solutions of the equation.)

  3. Another of al-Khwārizmī's problems was: a square and 21 equal ten of its roots, that is . Solve it by completing the square. Why might he have accepted both answers this time?

    Hint 1

    Rearrange to first.

    Hint 2

    .

    Full answer

    , so and . So or . Check: , and . Both answers are positive, so both can be real lengths. That is why this kind of problem, unlike , shows two answers even in a world without negative numbers.

  4. For which values of does have two distinct real solutions? Use completing the square, then check with the discriminant.

    Hint 1

    Write the equation as .

    Hint 2

    Two solutions need the right side to be positive.

    Full answer

    , so . Two distinct solutions need , so . Check with the discriminant: gives . The same answer, because . At there is one repeated root, .

The bigger idea

Every method in this unit comes back to one move: turn the problem into "something squared equals a number", then undo the square, keeping both signs. Factorising does it when the numbers are kind; completing the square does it every time; the formula is the general record of doing it. When you understand that one move, the three methods stop being three things to learn and become one idea seen three ways.

The same move will return. Circles, written as , are completed squares in two directions at once. The next unit uses quadratics again, alongside straight lines, in simultaneous equations.

Key concepts in this lesson