Completing the Square
Every question with a fully worked solution.
- Completing the Square - Video - Completing the Square Watch
- Completing the Square - Video - Completing the Square - Solving Quadratic Equations Watch
- Completing the Square - Video - Completing the Square Example 2 Solve Quad. Equations Watch
- Completing the Square - Video - Solving Quadratic Equations By Completing The Square Watch
Theory
Completing the square rewrites \(x^{2}+bx\) as a perfect square by adding \(\left(\dfrac{b}{2}\right)^{2}\). This Year 11 Mathematics Advanced page uses it to solve quadratic equations in exact form, to show when there are no real solutions, to write a quadratic in vertex form \(y=a(x-h)^{2}+k\), to find a maximum or minimum, and to derive the quadratic formula.
A perfect square is an expression of the form \((x+p)^{2}=x^{2}+2px+p^{2}\). The constant term is the square of half the coefficient of \(x\).
So to complete the square on \(x^{2}+bx\), halve the coefficient of \(x\) and square it: \(x^{2}+bx+\left(\dfrac{b}{2}\right)^{2}=\left(x+\dfrac{b}{2}\right)^{2}\). The sign inside the bracket is the sign of \(b\).
To solve an equation, move the constant to the right, add \(\left(\dfrac{b}{2}\right)^{2}\) to both sides, then take the square root with \(\pm\). If the coefficient of \(x^{2}\) is not \(1\), divide every term by it before completing the square. If the right-hand side is negative, there are no real solutions, because a square is never negative.
To write \(y=ax^{2}+bx+c\) in vertex form \(y=a(x-h)^{2}+k\), take out the factor \(a\) from the \(x\) terms, then add and subtract the completing number inside the bracket. The vertex (turning point) is \((h,k)\) and the axis of symmetry is \(x=h\). If \(a>0\), \(k\) is the minimum value of \(y\); if \(a<0\), \(k\) is the maximum.
Completing the square:
Vertex form of a quadratic, vertex \((h,k)\), axis of symmetry \(x=h\):
Deriving the quadratic formula. Divide \(ax^{2}+bx+c=0\) by \(a\neq0\) and complete the square:
| \(x^{2}+\dfrac{b}{a}x\) | \(=\) | \(-\dfrac{c}{a}\) |
| \(x^{2}+\dfrac{b}{a}x+\dfrac{b^{2}}{4a^{2}}\) | \(=\) | \(\dfrac{b^{2}}{4a^{2}}-\dfrac{c}{a}\) |
| \(\left(x+\dfrac{b}{2a}\right)^{2}\) | \(=\) | \(\dfrac{b^{2}-4ac}{4a^{2}}\) |
| \(x+\dfrac{b}{2a}\) | \(=\) | \(\pm\dfrac{\sqrt{b^{2}-4ac}}{2a}\) |
| \(x\) | \(=\) | \(\dfrac{-b\pm\sqrt{b^{2}-4ac}}{2a}\) |
The square root is real only when \(b^{2}-4ac\ge0\).
How to solve by completing the square
- Move the constant to the right-hand side.
- Divide every term by the coefficient of \(x^{2}\) if it is not \(1\), so the left side is \(x^{2}+bx\).
- Add \(\left(\dfrac{b}{2}\right)^{2}\) to both sides and write the left side as \(\left(x+\dfrac{b}{2}\right)^{2}\).
- Take the square root of both sides with \(\pm\) (or stop: a negative right side means no real solutions).
- Solve for \(x\) and simplify any surd.
How to write \(y=ax^{2}+bx+c\) in vertex form
- Take out \(a\) from the \(x\) terms: \(y=a\left(x^{2}+\dfrac{b}{a}x\right)+c\).
- Complete the square inside: \(x^{2}-4x=(x-2)^{2}-4\).
- Expand the outer factor over the subtracted number and collect the constants.
- Read off the vertex \((h,k)\), the axis \(x=h\), and the maximum or minimum value \(k\).
Add \(\left(\dfrac{12}{2}\right)^{2}=36\) to both sides:
| \(x^{2}+12x+36\) | \(=\) | \(-24+36\) |
| \((x+6)^{2}\) | \(=\) | \(12\) |
| \(x+6\) | \(=\) | \(\pm\sqrt{12}=\pm2\sqrt{3}\) |
\(\therefore\ x=\boldsymbol{-6\pm2\sqrt{3}}\)
Move the constant, then add \(\left(\dfrac{-10}{2}\right)^{2}=25\):
| \(x^{2}-10x\) | \(=\) | \(-27\) |
| \(x^{2}-10x+25\) | \(=\) | \(-27+25\) |
| \((x-5)^{2}\) | \(=\) | \(-2\) |
For every real \(x\), \((x-5)^{2}\ge0\), so it can never equal \(-2\).
\(\therefore\) the equation has no real solutions.
Divide by \(2\), then add \(\left(\dfrac{-3}{2}\right)^{2}=\dfrac{9}{4}\):
| \(2x^{2}-6x\) | \(=\) | \(3\) |
| \(x^{2}-3x\) | \(=\) | \(\dfrac{3}{2}\) |
| \(x^{2}-3x+\dfrac{9}{4}\) | \(=\) | \(\dfrac{6}{4}+\dfrac{9}{4}\) |
| \(\left(x-\dfrac{3}{2}\right)^{2}\) | \(=\) | \(\dfrac{15}{4}\) |
| \(x-\dfrac{3}{2}\) | \(=\) | \(\pm\dfrac{\sqrt{15}}{2}\) |
\(\therefore\ x=\boldsymbol{\dfrac{3\pm\sqrt{15}}{2}}\)
Take out the factor \(-2\) from the \(x\) terms, then complete the square:
| \(y\) | \(=\) | \(-2(x^{2}-4x)-3\) |
| \(\) | \(=\) | \(-2\left[(x-2)^{2}-4\right]-3\) |
| \(\) | \(=\) | \(-2(x-2)^{2}+8-3\) |
| \(\) | \(=\) | \(\boldsymbol{-2(x-2)^{2}+5}\) |
Vertex \(\mathbf{(2,5)}\); axis of symmetry \(\boldsymbol{x=2}\).
Since \(-2(x-2)^{2}\le0\), \(y\le5\), with equality when \(x=2\). The maximum value is \(\mathbf{5}\).
Common pitfalls
Frequently asked questions
What number do you add to complete the square?
Halve the coefficient of \(x\) and square it. For \(x^{2}-14x\), add \(\left(\dfrac{-14}{2}\right)^{2}=49\), giving \((x-7)^{2}\).
How do you complete the square when the coefficient of x squared is not 1?
To solve an equation, divide every term by that coefficient first. To write vertex form, take the coefficient out as a factor of the \(x\) terms and complete the square inside the bracket.
How do you find the vertex by completing the square?
Write the quadratic as \(y=a(x-h)^{2}+k\). The vertex is \((h,k)\) and the axis of symmetry is \(x=h\).
How does completing the square show there are no real solutions?
If you reach \((x-h)^{2}\) equal to a negative number, there is no real solution, because the square of a real number is never negative.
Where does the quadratic formula come from?
From completing the square on \(ax^{2}+bx+c=0\): dividing by \(a\) and completing the square gives \(\left(x+\dfrac{b}{2a}\right)^{2}=\dfrac{b^{2}-4ac}{4a^{2}}\), which rearranges to the formula.