Maths
What is completing the square, and how do you do it step by step?
Quick answer
Completing the square rewrites x² + bx + c as (x + b/2)² − (b/2)² + c. It solves quadratics, finds the vertex (turning point) of a parabola and proves the quadratic formula.
In one sentence
Completing the square means rewriting a quadratic like x² + 6x + 5 as a squared bracket plus a number, (x + 3)² − 4, so you can solve it or read off its turning point.
Explained
A perfect square is an expression like (x + 3)². If you multiply it out, you get x² + 6x + 9. Notice the pattern: the number in the bracket (3) is half of the x-coefficient (6), and the number at the end (9) is that half squared. In general,
(x + d)² = x² + 2dx + d²
Most quadratics are not perfect squares. x² + 6x + 5 is "almost" (x + 3)², but it has 5 at the end instead of 9. Completing the square fixes that: write the perfect square, then correct the constant.
x² + 6x + 5 = (x + 3)² − 9 + 5 = (x + 3)² − 4
The rule for any x² + bx + c is:
x² + bx + c = (x + b/2)² − (b/2)² + c
Why is it called completing the square? Picture x² as a square of tiles with side x, and 6x as two strips of 3x placed along two sides. The shape is almost a big square with side x + 3; only a 3 × 3 corner is missing. Adding those 9 small tiles completes the square. This picture is how mathematicians such as al-Khwarizmi solved quadratics more than a thousand years ago.
blocks
puzzle
ruler
Once a quadratic is in the form a(x + p)² + q, three things become easy:
- Solving. Move q across, divide by a and take square roots. Every quadratic equation can be solved this way, even ones that do not factorise. In fact, completing the square on ax² + bx + c = 0 is exactly how the quadratic formula is proved.
- The vertex (turning point). The graph of y = a(x + p)² + q has its vertex at (−p, q). This is called vertex form in the US and turning point form in many UK and Australian textbooks.
- Maximum and minimum values. A square is never negative, so (x + p)² + q is never smaller than q. If a is negative, the parabola opens downwards and q is the largest value instead.
When the x² term has a number in front (a ≠ 1), take that number out of the x² and x terms first: 2x² + 12x + 7 = 2(x² + 6x) + 7. Complete the square inside the bracket, then multiply back out.
Examples
| Expression | Half of b | Completed square |
|---|---|---|
| x² + 8x | 4 | (x + 4)² − 16 |
| x² − 10x + 30 | −5 | (x − 5)² − 25 + 30 = (x − 5)² + 5 |
| x² + 4x − 1 | 2 | (x + 2)² − 4 − 1 = (x + 2)² − 5 |
| x² + 5x + 2 | 5/2 | (x + 5/2)² − 25/4 + 2 = (x + 5/2)² − 17/4 |
| 2x² + 12x + 7 | 3 (inside the bracket) | 2(x + 3)² − 18 + 7 = 2(x + 3)² − 11 |
Worked example: solve x² − 6x + 2 = 0. Half of −6 is −3, so x² − 6x = (x − 3)² − 9. The equation becomes (x − 3)² − 9 + 2 = 0, which is (x − 3)² = 7. Take the square root of both sides: x − 3 = ±√7, so x = 3 + √7 ≈ 5.65 or x = 3 − √7 ≈ 0.35.
Common mistakes
- Forgetting to subtract the square. x² + 6x is not (x + 3)²: that would be x² + 6x + 9. Fix: always write (x + 3)² − 9 and then deal with the constant.
- Getting the sign in the vertex wrong. y = (x − 2)² + 5 has its vertex at (2, 5), not (−2, 5). Ask: what value of x makes the bracket zero?
- Halving b when a is not 1. For 3x² + 12x, take out the 3 first: 3(x² + 4x). Then halve 4, not 12.
- Taking only the positive square root. (x + 1)² = 9 gives x + 1 = 3 or x + 1 = −3, so x = 2 or x = −4.
- Forgetting to multiply the correction by a. 2(x² + 6x) = 2[(x + 3)² − 9] = 2(x + 3)² − 18, not 2(x + 3)² − 9.
Step by step
Step by step
- Make the x² coefficient 1If the quadratic is ax² + bx + c with a ≠ 1, factor a out of the first two terms: a(x² + (b/a)x) + c. In an equation you can divide everything by a instead.
- Halve the x-coefficientTake the number in front of x and halve it, keeping its sign. This number goes in the bracket.
- Write the square and subtractWrite (x + half)² and subtract half². Then add the original constant.
- Tidy upCombine the numbers at the end to get the form a(x + p)² + q.
- Use itTo solve, set it equal to 0, move q across, divide by a and take ± square roots. For a graph, the vertex is (−p, q).
Quick check: multiply your answer back out. If you get the original quadratic, the completed square is right.
Practice questions
Complete the square
Try each one, then check your answer.
- Complete the square for x² + 6x.
Show answer
Half of 6 is 3: (x + 3)² − 9 - Complete the square for x² − 10x.
Show answer
Half of −10 is −5: (x − 5)² − 25 - Complete the square for x² + 8x + 20.
Show answer
(x + 4)² − 16 + 20 = (x + 4)² + 4 - Complete the square for x² − 4x + 1.
Show answer
(x − 2)² − 4 + 1 = (x − 2)² − 3 - Complete the square for x² + 3x + 1.
Show answer
(x + 3/2)² − 9/4 + 1 = (x + 3/2)² − 5/4 - Which number makes x² + 14x + ___ a perfect square?
Show answer
Half of 14 is 7, and 7² = 49 - Solve (x − 3)² = 16.
Show answer
x − 3 = ±4, so x = 7 or x = −1 - Solve x² + 6x + 5 = 0 by completing the square.
Show answer
(x + 3)² − 4 = 0, (x + 3)² = 4, x + 3 = ±2, so x = −1 or x = −5 - Solve x² − 8x + 13 = 0, giving exact answers.
Show answer
(x − 4)² − 16 + 13 = 0, (x − 4)² = 3, so x = 4 ± √3 - Solve x² + 2x − 7 = 0, giving exact answers.
Show answer
(x + 1)² − 1 − 7 = 0, (x + 1)² = 8, so x = −1 ± 2√2 (√8 = 2√2) - Write 2x² + 12x + 7 in the form a(x + p)² + q.
Show answer
2(x² + 6x) + 7 = 2[(x + 3)² − 9] + 7 = 2(x + 3)² − 11 - Write 3x² − 6x + 5 in the form a(x + p)² + q.
Show answer
3(x² − 2x) + 5 = 3[(x − 1)² − 1] + 5 = 3(x − 1)² + 2 - Find the vertex of y = x² − 6x + 11.
Show answer
(x − 3)² − 9 + 11 = (x − 3)² + 2, so the vertex is (3, 2), a minimum - Find the maximum value of y = −x² + 4x + 1.
Show answer
−(x² − 4x) + 1 = −[(x − 2)² − 4] + 1 = −(x − 2)² + 5, so the maximum is 5, when x = 2 - Show that x² − 4x + 7 = 0 has no real solutions.
Show answer
(x − 2)² + 3 = 0 means (x − 2)² = −3, but a square cannot be negative: no real solutions - Solve 2x² − 4x − 3 = 0 by completing the square.
Show answer
Divide by 2: x² − 2x − 3/2 = 0, (x − 1)² = 1 + 3/2 = 5/2, so x = 1 ± √(5/2) ≈ 2.58 or −0.58
Word problems
Completing the square in real life
Try each one, then check your answer.
- A ball's height after t seconds is h = −5t² + 20t + 1 metres. Find its greatest height.
Show answer
−5(t² − 4t) + 1 = −5[(t − 2)² − 4] + 1 = −5(t − 2)² + 21, so 21 m, after 2 seconds - For the same ball, when is it 16 m high?
Show answer
−5t² + 20t + 1 = 16 gives t² − 4t + 3 = 0, (t − 2)² = 1, t − 2 = ±1: after 1 s and after 3 s - A rectangle with a perimeter of 40 m has width x and length 20 − x. What is the largest possible area?
Show answer
A = x(20 − x) = −x² + 20x = −(x − 10)² + 100, so 100 m² (a 10 m by 10 m square) - A rectangle is 4 m longer than it is wide, and its area is 60 m². How wide is it?
Show answer
x² + 4x = 60, (x + 2)² = 64, x + 2 = 8 (a width is positive), so 6 m wide (and 10 m long) - A club's profit for a ticket price of x dollars is P = −10x² + 120x − 200. Which price gives the most profit?
Show answer
−10(x² − 12x) − 200 = −10[(x − 6)² − 36] − 200 = −10(x − 6)² + 160: $6, for a profit of $160
Questions people ask
What is the completing the square formula?
For x² + bx + c, it is x² + bx + c = (x + b/2)² − (b/2)² + c. For ax² + bx + c it is a(x + b/2a)² + c − b²/4a. You do not need to memorise the second one if you take a out first.
What is completing the square used for?
Solving quadratic equations that do not factorise, finding the vertex (turning point) and the maximum or minimum of a quadratic, proving the quadratic formula, and later on rewriting the equation of a circle, such as x² + y² − 4x + 6y − 12 = 0 as (x − 2)² + (y + 3)² = 25.
How do you complete the square when a is not 1?
Factor a out of the x² and x terms, complete the square inside the bracket, then multiply the subtracted square by a. For 2x² + 8x + 1: 2(x² + 4x) + 1 = 2[(x + 2)² − 4] + 1 = 2(x + 2)² − 7.
Is completing the square better than the quadratic formula?
To solve an equation, both always work, and the formula is often quicker. Completing the square is better when you also need the vertex, the maximum or minimum, or when b is even and a = 1, because the numbers stay small.
How do you complete the square for GCSE?
GCSE Higher questions usually ask you to write x² + bx + c in the form (x + p)² + q, then use it to solve an equation or to give the turning point (−p, q). Show the halving step clearly: method marks are often given for (x + p)² even if the final number is wrong.
Can you complete the square on a calculator?
Some calculators and CAS apps will expand or factorise expressions, and many scientific calculators solve ax² + bx + c = 0 directly. Use them to check your answer, but exams expect the working by hand.
Quick quiz
Completing the square
Check what you know with 5 quick questions.
Question 1 of 5
Which number completes x² + 12x + ___ to make a perfect square?
Practise it
Try it
Practise completing the square with unlimited questions
Algebra worksheets
Practise it step by step in a full course: Grade 10 Maths
For grown-ups
Related topics
Quadratic equations and the quadratic formula
A quadratic equation looks like ax² + bx + c = 0. The quadratic formula x = (−b ± √(b² − 4ac)) ÷ 2a solves every one, and b² − 4ac tells you how many solutions there are.
Square roots
The square root of a number is the value that, multiplied by itself, gives that number. The square root of 25 is 5, because 5 × 5 = 25. The sign is √.
Algebra
Algebra is maths that uses letters, like x or n, to stand for numbers we don't know yet or numbers that can change. For example, if n + 3 = 10, then n = 7.
Functions (maths)
A function is a rule that gives exactly one output for each input. In f(x) = 2x + 3, the input 4 gives the output 2 × 4 + 3 = 11.
The quadratic formula and the discriminant
The quadratic formula x = (−b ± √(b² − 4ac)) / 2a solves any equation ax² + bx + c = 0. The discriminant b² − 4ac tells you whether there are two, one or no real solutions.
Vertex of a parabola
The vertex is the turning point of a parabola: its lowest or highest point. For y = ax² + bx + c it is at x = −b/2a; put that x back into the equation to get y.