Factorisation works only when the quadratic splits over rationals. Completing the square is a method that always works , for any quadratic, even those with irrational or no real roots.
The idea
The identity (x+h)2=x2+2hx+h2 tells us that any expression of the form x2+2hx is almost a perfect square; it just needs +h2 to complete it.
So to complete the square of x2+2hx+k, we write
x2+2hx+k=(x2+2hx+h2)+(k−h2)=(x+h)2+(k−h2).
Now any quadratic equation x2+2hx+k=0 becomes
(x+h)2=h2−k,
and we can square-root both sides (when the RHS is non-negative) to find x.
Algorithm
To solve ax2+bx+c=0 by completing the square:
Divide through by a: x2+abx+ac=0.
Move the constant: x2+abx=−ac.
Add (2ab)2 to both sides:
x2+abx+(2ab)2=−ac+4a2b2.
Rewrite the LHS as a square:
(x+2ab)2=4a2b2−4ac.
Take square roots and solve for x:
x+2ab=±2ab2−4ac⟹x=2a−b±b2−4ac.
This is the quadratic formula.
Deriving the formula
Notice how completing the square produces the formula. The quantity under the square root is exactly the discriminantD=b2−4ac. The formula tells us:
if D>0: two distinct real roots,
if D=0: one repeated real root x=−b/(2a),
if D<0: no real root (the square root of a negative number is not real).
So one derivation gives us both how to solve and what kind of solutions to expect.
Worked examples
Example 1. Solve x2+6x+7=0 by completing the square.
x2+6x=−7⇒x2+6x+9=2⇒(x+3)2=2⇒x+3=±2⇒x=−3±2.
Example 2. Solve 2x2−7x+3=0 by completing the square.
Divide by 2: x2−(7/2)x+3/2=0. Move constant: x2−(7/2)x=−3/2.
Example 4. Solve x2+4x+8=0 by completing the square.
x2+4x=−8⇒(x+2)2=4−8=−4. Square of a real number cannot be negative , no real solutions.
(This matches D=16−32=−16<0.)
Example 5. Solve x2−4x+4=0.
x2−4x+4=(x−2)2=0⇒x=2 (repeated).
Try it yourself
Solve x2−4x−5=0 by completing the square.
Solve x2+8x+12=0 by completing the square.
Solve 3x2+5x+2=0 by completing the square.
Solve 2x2−4x−3=0 by completing the square.
Solve x2+2x+2=0. Does the equation have real solutions?
Solve 5x2+6x=4 by completing the square.
Solve x2+x−1=0 by completing the square; compare with the quadratic formula.
Show that x2+2x+3>0 for all real x by completing the square.
Solve x2−(3+1)x+3=0 by completing the square.
Solve 9x2−15x+6=0 by completing the square.
Pitfalls / Insight
Always divide by the leading coefficient first. Trying to complete the square with a=1 at the front leads to arithmetic errors.
Don't forget to add (b/2)2 to BOTH sides , completing the square is symmetric.
Recognise (x+h)2=negative as a signal of no real solutions, not as a mistake.
Insight. Completing the square is the derivation of the quadratic formula , and you'll see the same move (turning into a sum of squares) in coordinate geometry, calculus and statistics later. Master it once and reuse.
Practice quiz
Quick check on this topic.
Quiz
Quick check : Completing the square
6 questions · pick the best answer
Q1
To complete the square of x2+6x, add:
Q2
Solving x2+6x+7=0 by completing the square gives x=:
Q3
x2+4x+8=0 by completing the square yields (x+2)2=:
Q4
To complete the square of 2x2+8x, first:
Q5
Solving 4x2+4x−3=0 by completing the square gives roots: