Quadratics & their graphs · Lesson 4 of 6

Completing the square

Rewrite x² + bx + c as a square plus a number. It solves any quadratic, finds the vertex, and is where the formula comes from.

15 minYou should already know: Linear & simultaneous equations
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

Not every quadratic factorises neatly. x2+6x+2x^2 + 6x + 2 has no pair of whole numbers that multiply to 2 and add to 6. Completing the square works every time, and the picture below shows why it’s called that.

See it as area

Completing the squareStage 1 of 5

x² + 6x

x²6xxx
A square and a rectangle. x² is a square with sides x. 6x is a rectangle, x long and 6 wide.

Step through the stages, then change the number in front of xx and step through again. The corner is always half the number, squared.

Solving an equation this way

  1. Get the x2x^2 and xx terms on one side and the number on the other.
  2. Add (b2)2\left(\frac b2\right)^2 to both sides, so the left side becomes a perfect square.
  3. Take the square root of both sides, remembering ±\pm.
  4. Solve for xx.

For x2+6x+2=0x^2 + 6x + 2 = 0:

x2+6x=−2x^2 + 6x = -2 x2+6x+9=−2+9⇒(x+3)2=7x^2 + 6x + 9 = -2 + 9 \quad\Rightarrow\quad (x + 3)^2 = 7 x+3=±7⇒x=−3±7x + 3 = \pm\sqrt7 \quad\Rightarrow\quad x = -3 \pm \sqrt 7

So x≈−0.35x \approx -0.35 or x≈−5.65x \approx -5.65 (to 2 decimal places).

When there’s a number in front of x²

Take it out as a factor of the xx terms, or divide the whole equation by it. Don’t divide an expression that isn’t set equal to 0: that changes it.

For 3y2−5y+2=03y^2 - 5y + 2 = 0, divide through by 3:

y2−53y+23=0⇒(y−56)2=2536−2436=136y^2 - \tfrac53 y + \tfrac23 = 0 \quad\Rightarrow\quad \left(y - \tfrac56\right)^2 = \tfrac{25}{36} - \tfrac{24}{36} = \tfrac{1}{36}

so y−56=±16y - \frac56 = \pm\frac16, giving y=1y = 1 or y=23y = \frac23.

Using the perfect squares

The same picture gives two expansions worth knowing by heart: (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 and (a−b)2=a2−2ab+b2(a - b)^2 = a^2 - 2ab + b^2. An expression is a perfect square when it fits one of these exactly, and they link a2+b2a^2 + b^2 with a+ba + b, a−ba - b and abab. For example, if a+b=5a + b = 5 and ab=4ab = 4, then a2+b2=(a+b)2−2ab=25−8=17a^2 + b^2 = (a + b)^2 - 2ab = 25 - 8 = 17.

a²ababb²abab
(a + b)²The square splits into a², two ab rectangles and b²

Finding the vertex, and the least or greatest value

Once yy is written as (x+p)2+q(x + p)^2 + q, the vertex is easy to see. A square is never negative, so (x+p)2(x + p)^2 is smallest (0) when x=−px = -p. Then y=qy = q.

A past question, step by step

Worked example · WAEC 2022

WAEC 2022 · Paper 1 · Q16

What value of pp will make (x2−4x+p)(x^2 - 4x + p) a perfect square?

  1. What a perfect square looks like

    A perfect square is (x+k)2(x + k)^2 for some number kk. Here the xx term is −4x-4x, so kk is half of −4-4.

    Think first. Half of −4-4 is −2-2. What do you get when you expand (x−2)2(x - 2)^2?

  2. Expand it

    (x−2)2=x2−4x+4(x - 2)^2 = x^2 - 4x + 4

    Comparing with x2−4x+px^2 - 4x + p gives p=4p = 4. The answer is C.

Your turn

JAMB 1997 · UME · Q13

Find the minimum value of x2−3x+2x^2 - 3x + 2 for all real values of xx.

Worked solution (try it first)
  1. Complete the square: half of −3-3 is −32-\frac32, so x2−3x=(x−32)2−94x^2 - 3x = \left(x - \frac32\right)^2 - \frac94.
  2. So x2−3x+2=(x−32)2−94+2x^2 - 3x + 2 = \left(x - \frac32\right)^2 - \frac94 + 2
    =(x−32)2−14= \left(x - \frac32\right)^2 - \frac14.
  3. A square is never negative, so the minimum value is −14-\frac14, option A.

Report a problem with this question

More past questions like this