Keep both signs when taking a square root of both sides
Sort the roots by the sign of the number under the square root
Divide by a first when the leading coefficient is not one
The constant that completes a square
Take x2+6x. What constant turns it into a perfect square? The picture below shows the answer. The two
terms tile an L-shape, a square of area x2 and two strips whose areas together make 6x. That L is
missing one corner, and the corner that fills it is 3 by 3, area 9, because each strip already has
length 3. Adding that 9 completes the figure into a full square of side x+3:
x2+6x+9=(x+3)2. 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.
The picture works here because 6 is positive, so each strip has a sensible length. The pattern behind it
is algebraic, and algebra also covers a negative middle coefficient, where there is no picture to draw.
You already know from the squares-of-binomials lesson that squaring a sum produces a three-term pattern:
(x+p)2=x2+2px+p2.
Read this from right to left. Compare x2+6x with x2+2px+p2: the middle terms agree when
2p=6, so p=3, and the last term must be p2=9, exactly the corner you just added. The same
matching works for any linear coefficient b in place of 6. Compare x2+bx with x2+2px+p2:
the middle terms agree when 2p=b, so p=2b, and the constant that completes the square is
p2=(2b)2, the square of half the linear coefficient.
A quick check confirms it. Squaring x+2b gives
x2+2⋅2b⋅x+(2b)2, and 2⋅2b=b, so that is
exactly x2+bx+(2b)2, the trinomial you want.
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.
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.
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 fix is to add the constant you want and
immediately subtract it again. 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, inside the square. Written more generally, every quadratic with leading coefficient
1 can be put in the shape (x−h)2+k for some constants h and k. This is 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.
Check your understanding
Rewrite x2−10x+18 in completed-square form.
Half of b=−10 is −5, and the constant that completes the square is (−5)2=25. Add and subtract it.
x2−10x+18=(x2−10x+25)−25+18=(x−5)2−7
A quick check expands it back: (x−5)2−7=x2−10x+25−7=x2−10x+18, the original.
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. A positive number is the square of two different numbers, one positive and one
negative, so both must be kept. That is where the ± sign comes from:
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 a search for integer factors would 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 b and c you have used so far is an ordinary real number, and that stays true for the rest of
this lesson. Every solve reaches the same crossroads: after isolating the square you have
(x+2b)2=R,where R=(2b)2−c.
The number R on the right decides everything, because you are about to take its square root, and there
are exactly three cases. (The next lesson gives this same quantity, scaled up, its own name, the
discriminant; here it is just “the number on the right.”)
If R>0, its square root is a nonzero real number, so the ± produces two different real
solutions, as in x=3±5 above.
If R=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 R<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
R<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 R<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.
Check your understanding
Solve 2x2+4x+10=0 by completing the square.
Divide the whole equation by the leading coefficient 2 first: x2+2x+5=0. Move the constant across and add (22)2=1 to both sides.
x2+2x+1=−5+1=−4
The left side is (x+1)2=−4, so x+1=±−4=±2i and x=−1±2i. The option x=−2±4i simply doubles both parts of the correct answer; substituting it back into the original equation gives −22−16i, not 0, so it is not a solution.
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.
Practice problems at the level of the course, to be worked out on paper. Hints one at a
time, then the answer or the full worked solution, with your progress kept in this browser.
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 wrote his rules in words and justified them
with a picture. 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. For this equation, the algebra also allows x=−13, but a length of −13 has no place in
a drawing. So the geometric method returned only the one positive root.
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
R<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. For this equation, the second root, x=−13, is the one
that particular drawing could never show.