This site is a work in progress. New lessons are added regularly.
Contact us
Completing the Square
Learning goals
Add the square of half the linear coefficient
Rewrite a quadratic in completed-square form
Take the square root of both sides with a ±
Sort the roots by the sign of D
Divide by a first when the leading coefficient is not one
The constant that completes a square
You already know from the squares-of-binomials chapter that squaring a sum produces a three-term pattern:
(x+p)2=x2+2px+p2.
Read this from right to left and it says something useful. Any expression shaped like
x2+(something)x+(something) might be a squared binomial. Such an expression is a
squared binomial only when its three pieces line up with x2, 2px, and p2 for a single value of
p. That matching is the whole idea of
completing the square, so look closely at what it forces.
Start with just the first two terms, x2+bx. Compare the middle term bx with the pattern’s middle
term 2px. For them to be the same, the coefficients must match, so 2p=b, which means p=2b.
Half of the linear coefficient is the only value of p that works. And once p is pinned down, the
pattern also tells you the missing last term: it must be p2=(2b)2.
Why adding (2b)2 turns x2+bx into a perfect square#
Take the two terms x2+bx and add the specific constant (2b)2 to them. The
claim is that the result is exactly the square of x+2b. To check it, expand that square with
the pattern (x+p)2=x2+2px+p2, using p=2b:
(x+2b)2=x2+2⋅x⋅2b+(2b)2.
The middle term simplifies, because 2⋅2b=b, leaving
(x+2b)2=x2+bx+(2b)2.
So x2+bx+(2b)2 is a genuine perfect square, and the constant that made it one
is (2b)2, the square of half the linear coefficient. The reason it has to be half
of b, and not b itself, is that squaring x+2b doubles the 2b in the middle
term. That doubling must land back on the coefficient b.
∎
So the recipe for the missing constant is short: take the coefficient of x, halve it, and square the
result. For x2+10x the half is 5 and the constant is 25, giving x2+10x+25=(x+5)2. For
x2−6x the half is −3 and the constant is 9, giving x2−6x+9=(x−3)2. The sign inside the
binomial follows the sign of b, because p=2b carries that sign along.
Rewriting a quadratic in completed-square form
A full quadratic x2+bx+c usually does not come with the constant (2b)2
already in place; it comes with some other constant c. The trick is to conjure the constant you want
without changing the expression, by adding it and subtracting it in the same breath. Adding and
subtracting the same number changes nothing, since the two moves cancel, but it lets you regroup:
x2+bx+c=perfect squarex2+bx+(2b)2−(2b)2+c.
The braced part collapses to (x+2b)2, and whatever is left over stays outside as
a plain constant:
x2+bx+c=(x+2b)2+(c−(2b)2).
This is the completed-square form. It says the same thing as the original quadratic, but now x
appears only once, safely inside the square. Written more generally, every quadratic can be put in the
shape (x−h)2+k for some constants h and k, a form we will lean on again later.
Worked example 1Rewrite x2+8x+3 in completed-square form
The linear coefficient is b=8, so half of it is 4 and the constant that completes the square is
42=16. Add and subtract that 16:
x2+8x+3=(x2+8x+16)−16+3.
The parenthesized trinomial is a perfect square, (x+4)2, and the loose constants combine
to −16+3=−13:
x2+8x+3=(x+4)2−13.
A quick check expands it back: (x+4)2−13=x2+8x+16−13=x2+8x+3, the original. The
constant dropped from 3 to −13 precisely because 16 was borrowed to build the square.
There is a picture behind the name. The two terms x2+bx tile an L-shape: a square of area x2 and
two strips whose areas together make bx. That L is missing one corner, and the corner you need to fill
it is exactly a 2b by 2b square, of area (2b)2. Adding it
literally completes the figure into a full square of side x+2b.
Completing the square, seen as area. The piece of area x squared and the two strips of area 3x each tile an L-shape. Adding the 3-by-3 corner of area 9 fills the notch, making a full square of side x + 3, so x squared plus 6x plus 9 equals (x + 3) squared.
Check your understanding
What constant must you add to x2+12x to complete the square?
Halve the coefficient of x, then square the result. Here b=12, so half of it is 6.
(212)2=62=36
Adding 36 gives x2+12x+36=(x+6)2. Adding 6 (the half) or 144 (b2) does not build a square.
Solving a quadratic by completing the square
Rewriting is the hard part; solving is what it unlocks. To solve x2+bx+c=0, isolate the square
and then take a square root. The steps run in a fixed order.
First move the constant to the right side, so the left holds only the x terms:
x2+bx=−c.
Next add (2b)2 to both sides. Adding it to just the left would change the
equation; adding it to both sides keeps the balance while turning the left into a perfect square:
x2+bx+(2b)2=(2b)2−c.
The left side is now (x+2b)2. Take the square root of both sides, and here is the
step people forget. Since the square root of a positive number splits into two cases, positive and
negative, a ± sign appears:
x+2b=±(2b)2−c.
Finally subtract 2b to isolate x, which gives the general result
x=−2b±(2b)2−c.
You do not need to memorize that line; it is faster and safer to run the four steps each time. What it
shows is that completing the square always finishes a quadratic, whatever b and c are.
Worked example 2Solve x2−6x+4=0
This quadratic has no whole-number factor pair that works, so factoring is a dead end. Complete the
square instead. Move the constant across:
x2−6x=−4.
Here b=−6, so 2b=−3 and (2b)2=9. Add 9 to both sides:
x2−6x+9=−4+9=5.
The left side is the perfect square (x−3)2, so take the square root of both sides, keeping both
signs:
(x−3)2=5⇒x−3=±5.
Add 3 to finish:
x=3±5.
The two solutions are x=3+5 and x=3−5, both perfectly real even though neither is
a whole number. This is the kind of answer factoring could never have found.
When b is odd, half of it is a fraction, and (2b)2 becomes a fraction with 4 in
the denominator. Nothing about the method changes; you just carry the fractions carefully.
Worked example 3Solve x2+3x+1=0 (an odd middle coefficient)
Move the constant across, then halve the odd coefficient b=3:
x2+3x=−1,2b=23,(23)2=49.
Add 49 to both sides. On the right, write −1 as −44 so the fractions combine:
x2+3x+49=−1+49=−44+49=45.
The left side is (x+23)2. Take the square root of both sides, remembering that
45=25 since the denominator 4 is a perfect square:
(x+23)2=45⇒x+23=±25.
Subtract 23 and combine over the common denominator 2:
x=−23±25=2−3±5.
The single fraction 2−3±5 holds both roots at once, which is the standard way to
write them.
Check your understanding
Solve x2+4x+1=0 by completing the square.
Move the constant across, then add (24)2=4 to both sides.
x2+4x+4=−1+4=3
The left side is (x+2)2, so x+2=±3 and x=−2±3. The half of b is 2, giving x+2, so the solution centers on −2, not 2 or −4.
Real, repeated, and complex roots
Every solve reaches the same crossroads: after isolating the square you have
(x+2b)2=D,where D=(2b)2−c.
The number D on the right decides everything, because you are about to take its square root, and there
are exactly three cases.
If D>0, its square root is a nonzero real number, so the ± produces two different real
solutions, as in x=3±5 above.
If D=0, its square root is 0, and ±0 is just 0, so the two solutions collapse into one
repeated solutionx=−2b. For instance x2−8x+16=0 becomes (x−4)2=0, whose
only root is x=4, met twice.
If D<0, you are taking the square root of a negative number. Before this chapter that meant no
solution, but you now have the imaginary unit i with i2=−1, and −1=i. So the root exists
after all, and the ± produces two complex solutions, a conjugate pair x=−2b±(something)i.
Worked example 4Solve x2+2x+5=0 (complex roots)
Move the constant across and add (22)2=1 to both sides:
x2+2x=−5,x2+2x+1=−5+1=−4.
The left side is (x+1)2, and the right side is negative, which is the signal that the roots are
complex:
(x+1)2=−4⇒x+1=±−4.
Rewrite the square root of the negative using i, as you learned two lessons ago:
−4=i4=2i. Then
x+1=±2i⇒x=−1±2i.
The solutions are the conjugate pair x=−1+2i and x=−1−2i. A quick check confirms the first:
(−1+2i)2+2(−1+2i)+5=(1−4i+4i2)+(−2+4i)+5=(1−4i−4)−2+4i+5=0.
This is the payoff the chapter was built for. Back when you only had real numbers, a quadratic with
D<0 simply had no answer, and you had to stop. Now that i is available, the square root of a negative
number is an ordinary complex number, so every quadratic has solutions, whether real or complex. That
is exactly why this chapter introduced the imaginary unit before turning to quadratics: completing the
square would otherwise dead-end on any equation with D<0.
Check your understanding
Solve x2−2x+10=0 by completing the square.
Move the constant across and add (2−2)2=1 to both sides.
x2−2x+1=−10+1=−9
The left side is (x−1)2=−9, so x−1=±−9=±3i and x=1±3i. The right side is negative, so the roots are complex, not the real 1±3; and −9=3i, not 9i.
When the leading coefficient is not 1
Everything so far assumed the x2 term stood alone, with coefficient 1. When a quadratic starts with
ax2 for some a=1, the pattern x2+bx+(2b)2 no longer matches directly.
The fix is to make the leading coefficient 1 first. For an equation, the cleanest way is to divide every
term by a; because the right side is 0, dividing does not disturb it. Then complete the square on the
result as usual.
Worked example 5Solve 2x2+8x−10=0 and 3x2+6x+9=0
For 2x2+8x−10=0, divide every term by the leading coefficient 2 to make the x2 term stand
alone:
22x2+28x−210=0⇒x2+4x−5=0.
Now complete the square. Move the constant across and add (24)2=4 to both sides:
x2+4x+4=5+4=9⇒(x+2)2=9.
Take the root of both sides, x+2=±3, so x=1 or x=−5, two real solutions.
For 3x2+6x+9=0, divide through by 3 first:
x2+2x+3=0.
Add (22)2=1 to both sides after moving the constant over:
x2+2x+1=−3+1=−2⇒(x+1)2=−2.
The right side is negative, so the roots are complex. Since −2=i2,
x+1=±i2⇒x=−1±i2.
Dividing by a at the very start is what kept both problems inside the method you already know.
Running these same steps on the fully general quadratic ax2+bx+c=0, with letters in place of
numbers, produces a single formula for the roots. That is the subject of the next lesson; completing the
square is the derivation behind it.
Common mistakes
Practice
Multiple Choice Questions (MCQ)
Progressively harder sets of questions. Each opens on its own page.
Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its
own so you can check yourself and try again, then the full worked solution, plus a rubric
to mark your own work against.
The name of this method is not a figure of speech. It began as an instruction to finish a drawing.
Around the year 820, in Baghdad, a scholar called al-Khwarizmi wrote a book on solving equations. He
had no symbol for x and no way to write an exponent, so he argued with pictures. For the problem we
would write as x2+10x=39, he drew a square of side x and laid strips along two of its sides.
The figure was one corner short of a larger square. He filled the corner in and read the answer off
the finished side. That corner is the constant you added in this lesson.
The picture carried a hidden cost, and the cost outlasted the picture. A drawn square cannot have a
negative side. So the method returned one root, and the other root was simply not there to be found.
Europe kept the habit for centuries after the diagrams were gone. Negative roots were called false,
absurd, and fictitious. A square root of a negative was refused outright. That is why a quadratic with
D<0 was reported as having no solution at all, rather than as having two.
Nothing in the method ever changed. What changed was which numbers people would accept as answers.
Once negatives were admitted, and then complex numbers after them, the same four steps you ran here
began returning both roots of every quadratic. The ± you were careful not to drop is the part the
drawing could never show you.