Completing the Square: Method and Worked Examples

Completing the square: method and worked examples for E-Math and A-Math

The short answer

Completing the square rewrites a quadratic ax2 + bx + c in the form a(x − h)2 + k. The numbers h and k are the useful part: the turning point of the graph is (h, k), and k is the minimum value if a is positive or the maximum value if a is negative. This guide shows the method for a = 1 and a ≠ 1, then six worked examples for O-Level E-Math and A-Math.

Why completing the square matters

Completing the square is not just a trick for one topic. It shows up all over Sec 3 and Sec 4 work:

  • Turning point: you can read off the vertex (h, k) without drawing the graph or using calculus.
  • Maximum and minimum values: a square can never be negative, so a(x − h)2 + k has its smallest or largest value exactly when x = h.
  • Sketching: the vertex and the y-intercept already give you the shape of the curve.
  • Solving equations: when a quadratic does not factorise, you can still get exact answers with surds.
  • Proofs: it is the standard way to show an expression is always positive or always negative.

The completing the square formula

The key idea is that (x + p)2 = x2 + 2px + p2. So x2 + bx needs “half of b, squared” to become a perfect square. The completing the square formula for a = 1 is:

x2 + bx + c = (x + b/2)2 + c − (b/2)2

Here h = −b/2 and k = c − (b/2)2. You do not need to memorise this line. Learn the steps below and the result follows every time.

How to complete the square: the method

When the coefficient of x2 is 1

  1. Take the coefficient of x and halve it.
  2. Write (x + that number)2.
  3. Subtract the square of that number, because the bracket has added it in.
  4. Add the original constant term and simplify.

When the coefficient of x2 is not 1

  1. Factor out a from the x2 and x terms only. Leave the constant outside for now.
  2. Complete the square inside the bracket, as above.
  3. Multiply the extra term you subtracted by a, so it comes out of the bracket correctly.
  4. Add the constant and simplify to reach a(x − h)2 + k.

A quick check at the end: expand your answer. If you get the original expression back, you are done.

Worked examples: completing the square

Worked example 1: x2 + 6x + 2

Question: Express x2 + 6x + 2 in the form (x + p)2 + q and state the turning point.

Solution: Half of 6 is 3. So x2 + 6x + 2 = (x + 3)2 − 32 + 2 = (x + 3)2 − 7. The turning point is (−3, −7), and it is a minimum because the coefficient of x2 is positive.

Worked example 2: x2 − 5x + 1 (with fractions)

Question: Express x2 − 5x + 1 in completed-square form.

Solution: Half of −5 is −5/2. So x2 − 5x + 1 = (x − 5/2)2 − (5/2)2 + 1 = (x − 5/2)2 − 25/4 + 4/4 = (x − 5/2)2 − 21/4. The turning point is (5/2, −21/4), which is (2.5, −5.25). Do not be put off by fractions. The steps are exactly the same.

Worked example 3: 2x2 − 12x + 5

Question: Express 2x2 − 12x + 5 in the form a(x − h)2 + k. Hence state its minimum value and the value of x where it occurs.

Solution: Factor 2 out of the first two terms: 2(x2 − 6x) + 5. Half of −6 is −3, so x2 − 6x = (x − 3)2 − 9. Then 2[(x − 3)2 − 9] + 5 = 2(x − 3)2 − 18 + 5 = 2(x − 3)2 − 13.

Since 2(x − 3)2 ≥ 0, the minimum value is −13, and it occurs when x = 3. The turning point is (3, −13). You can confirm this by sketching the graph of y = 2x2 − 12x + 5: the lowest point sits at x = 3, y = −13.

Graph of y = 2(x - 3)^2 - 13 showing the minimum point (3, -13) found by completing the square

Worked example 4: −x2 + 4x + 7 (negative a)

Question: Express −x2 + 4x + 7 in the form a(x − h)2 + k and find its maximum value.

Solution: Factor −1 out of the first two terms: −(x2 − 4x) + 7. Half of −4 is −2, so x2 − 4x = (x − 2)2 − 4. Then −[(x − 2)2 − 4] + 7 = −(x − 2)2 + 4 + 7 = −(x − 2)2 + 11.

Now −(x − 2)2 ≤ 0, so the expression is at most 11. The maximum value is 11, when x = 2. The turning point is (2, 11). Watch the sign: the −1 multiplies the −4 as well, which turns it into +4.

Graph of y = -(x - 2)^2 + 11 showing the maximum point (2, 11)

Worked example 5: solve x2 + 4x − 1 = 0

Question: Solve x2 + 4x − 1 = 0 by completing the square. Give your answers in exact form.

Solution: Complete the square: (x + 2)2 − 4 − 1 = 0, so (x + 2)2 − 5 = 0. Then (x + 2)2 = 5. Take the square root of both sides, remembering both signs: x + 2 = √5 or x + 2 = −√5.

So x = −2 + √5 or x = −2 − √5. As decimals, these are about 0.236 and −4.236 (0.236 and −4.24 to 3 significant figures). The quadratic does not factorise, which is why this method is needed.

Worked example 6: show that x2 − 4x + 7 is always positive

Question: Show that x2 − 4x + 7 is positive for all real values of x.

Solution: Complete the square: x2 − 4x + 7 = (x − 2)2 − 4 + 7 = (x − 2)2 + 3. Since (x − 2)2 ≥ 0 for every real x, the expression is at least 0 + 3 = 3. So x2 − 4x + 7 ≥ 3 > 0, which means it is always positive. In an exam, always write the final line that links the square to the conclusion.

Stuck on completing the square or other Sec 3 and Sec 4 topics? Our E-Math tuition and A-Math tuition pages explain how our live online math tuition helps students work through them.

Where the quadratic formula comes from

The quadratic formula is simply completing the square done once, on the general equation ax2 + bx + c = 0:

  1. Divide by a: x2 + (b/a)x + c/a = 0.
  2. Complete the square: (x + b/2a)2 − b2/4a2 + c/a = 0.
  3. Move the constants across: (x + b/2a)2 = (b2 − 4ac)/4a2.
  4. Take square roots: x + b/2a = ±√(b2 − 4ac) / 2a.
  5. So x = (−b ± √(b2 − 4ac)) / 2a.

This also explains the discriminant. If b2 − 4ac is negative, you cannot take the square root, so there are no real roots. That is the same idea as Worked example 6.

Common mistakes to avoid

  • Forgetting to subtract the square. Writing (x + 3)2 + 2 for x2 + 6x + 2 is wrong, because the bracket already contains an extra 9.
  • Using b instead of b/2. Half the coefficient of x goes in the bracket.
  • Sign errors in the bracket. x2 − 6x gives (x − 3)2, not (x + 3)2. The turning point is then at x = +3.
  • Factoring out a from the constant too. Only the x2 and x terms go inside the bracket.
  • Not multiplying the subtracted term by a. In 2(x − 3)2 − 9, the 9 must become 18.
  • Dropping the ± when solving. Square roots give two answers.
  • Mixing up maximum and minimum. Positive a means a minimum. Negative a means a maximum.

Frequently asked questions

What is completing the square used for?

It is used to find the turning point and the maximum or minimum value of a quadratic, to solve equations that do not factorise, to sketch graphs, and to prove that an expression is always positive or always negative.

How do I know if the turning point is a maximum or a minimum?

Look at the sign of a in a(x − h)2 + k. If a is positive the graph opens upwards and (h, k) is a minimum. If a is negative the graph opens downwards and (h, k) is a maximum.

Is completing the square in the O-Level E-Math and A-Math syllabus?

Quadratic expressions, equations and graphs are core topics in both subjects, and completing the square is a standard way to handle them. Check the latest syllabus from SEAB for the exact wording of what is examined in your subject.

Should I use the quadratic formula or completing the square?

Use whichever the question asks for. If it says “by completing the square”, you must show that method. If it only says “solve”, the formula is usually faster. When a question asks for the turning point or the maximum value, completing the square is the better tool.

How can I check my completed-square answer?

Expand your answer and see if you get the original expression back. You can also substitute x = 0: both forms must give the same value, which is the constant term of the original quadratic.

Keep practising

The fastest way to get comfortable is to repeat the six worked examples with different numbers until the steps feel automatic. If you would like guidance from a teacher, see our E-Math tuition and A-Math tuition pages. Keep our O-Level A-Math formula sheet handy while you revise, and check your working against the model solutions.

Found this useful? See how we teach it live.

See online math tuition → Book an Online Trial