Math Lab
Home/Class X/Ch 4/Completing the square

Completing the square

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(x + h)^2 = x^2 + 2 h x + h^2 tells us that any expression of the form x2+2hxx^2 + 2 h x is almost a perfect square; it just needs +h2+ h^2 to complete it.

So to complete the square of x2+2hx+kx^2 + 2 h x + k, we write x2+2hx+k=(x2+2hx+h2)+(kh2)=(x+h)2+(kh2).x^2 + 2 h x + k = (x^2 + 2 h x + h^2) + (k - h^2) = (x + h)^2 + (k - h^2).

Now any quadratic equation x2+2hx+k=0x^2 + 2 h x + k = 0 becomes (x+h)2=h2k,(x + h)^2 = h^2 - k, and we can square-root both sides (when the RHS is non-negative) to find xx.

Algorithm

To solve ax2+bx+c=0a x^2 + b x + c = 0 by completing the square:

  1. Divide through by aa: x2+bax+ca=0x^2 + \dfrac{b}{a} x + \dfrac{c}{a} = 0.
  2. Move the constant: x2+bax=cax^2 + \dfrac{b}{a} x = -\dfrac{c}{a}.
  3. Add (b2a)2\left(\dfrac{b}{2 a}\right)^2 to both sides: x2+bax+(b2a)2=ca+b24a2.x^2 + \frac{b}{a} x + \left(\frac{b}{2 a}\right)^2 = -\frac{c}{a} + \frac{b^2}{4 a^2}.
  4. Rewrite the LHS as a square: (x+b2a)2=b24ac4a2.\left(x + \frac{b}{2 a}\right)^2 = \frac{b^2 - 4 a c}{4 a^2}.
  5. Take square roots and solve for xx: x+b2a=±b24ac2a    x=b±b24ac2a.x + \frac{b}{2 a} = \pm \frac{\sqrt{b^2 - 4 a c}}{2 a} \implies x = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}.

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 discriminant D=b24acD = b^2 - 4 a c. The formula tells us:

  • if D>0D > 0: two distinct real roots,
  • if D=0D = 0: one repeated real root x=b/(2a)x = -b/(2 a),
  • if D<0D < 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=0x^2 + 6 x + 7 = 0 by completing the square.

x2+6x=7x2+6x+9=2(x+3)2=2x+3=±2x=3±2x^2 + 6 x = -7 \Rightarrow x^2 + 6 x + 9 = 2 \Rightarrow (x + 3)^2 = 2 \Rightarrow x + 3 = \pm \sqrt{2} \Rightarrow x = -3 \pm \sqrt{2}.

Example 2. Solve 2x27x+3=02 x^2 - 7 x + 3 = 0 by completing the square.

Divide by 22: x2(7/2)x+3/2=0x^2 - (7/2) x + 3/2 = 0. Move constant: x2(7/2)x=3/2x^2 - (7/2) x = -3/2.

Add (7/4)2=49/16(7/4)^2 = 49/16: x2(7/2)x+49/16=3/2+49/16=24/16+49/16=25/16x^2 - (7/2) x + 49/16 = -3/2 + 49/16 = -24/16 + 49/16 = 25/16.

(x7/4)2=25/16x7/4=±5/4x=(7±5)/4=3,1/2\left(x - 7/4\right)^2 = 25/16 \Rightarrow x - 7/4 = \pm 5/4 \Rightarrow x = (7 \pm 5)/4 = 3, 1/2.

Example 3. Solve 4x2+4x3=04 x^2 + 4 x - 3 = 0 by completing the square.

Divide by 44: x2+x3/4=0x^2 + x - 3/4 = 0. Move constant: x2+x=3/4x^2 + x = 3/4.

Add (1/2)2=1/4(1/2)^2 = 1/4: x2+x+1/4=1x^2 + x + 1/4 = 1. (x+1/2)2=1\left(x + 1/2\right)^2 = 1. x+1/2=±1x + 1/2 = \pm 1. x=1/2,3/2x = 1/2, -3/2.

Example 4. Solve x2+4x+8=0x^2 + 4 x + 8 = 0 by completing the square.

x2+4x=8(x+2)2=48=4x^2 + 4 x = -8 \Rightarrow (x + 2)^2 = 4 - 8 = -4. Square of a real number cannot be negative , no real solutions.

(This matches D=1632=16<0D = 16 - 32 = -16 < 0.)

Example 5. Solve x24x+4=0x^2 - 4 x + 4 = 0.

x24x+4=(x2)2=0x=2x^2 - 4 x + 4 = (x - 2)^2 = 0 \Rightarrow x = 2 (repeated).

Try it yourself

  1. Solve x24x5=0x^2 - 4 x - 5 = 0 by completing the square.
  2. Solve x2+8x+12=0x^2 + 8 x + 12 = 0 by completing the square.
  3. Solve 3x2+5x+2=03 x^2 + 5 x + 2 = 0 by completing the square.
  4. Solve 2x24x3=02 x^2 - 4 x - 3 = 0 by completing the square.
  5. Solve x2+2x+2=0x^2 + 2 x + 2 = 0. Does the equation have real solutions?
  6. Solve 5x2+6x=45 x^2 + 6 x = 4 by completing the square.
  7. Solve x2+x1=0x^2 + x - 1 = 0 by completing the square; compare with the quadratic formula.
  8. Show that x2+2x+3>0x^2 + 2 x + 3 > 0 for all real xx by completing the square.
  9. Solve x2(3+1)x+3=0x^2 - (\sqrt{3} + 1) x + \sqrt{3} = 0 by completing the square.
  10. Solve 9x215x+6=09 x^2 - 15 x + 6 = 0 by completing the square.

Pitfalls / Insight

  • Always divide by the leading coefficient first. Trying to complete the square with a1a \ne 1 at the front leads to arithmetic errors.
  • Don't forget to add (b/2)2(b/2)^2 to BOTH sides , completing the square is symmetric.
  • Recognise (x+h)2=negative(x + h)^2 = \text{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+6xx^2 + 6x, add:

Q2

Solving x2+6x+7=0x^2 + 6x + 7 = 0 by completing the square gives x=x = :

Q3

x2+4x+8=0x^2 + 4x + 8 = 0 by completing the square yields (x+2)2=(x+2)^2 = :

Q4

To complete the square of 2x2+8x2x^2 + 8x, first:

Q5

Solving 4x2+4x3=04x^2 + 4x - 3 = 0 by completing the square gives roots:

Q6

x2+2x+3>0x^2 + 2x + 3 > 0 for all real xx because: