Toggle Main Menu Toggle Search

Completing the Square

Completing the Square

A quadratic in the variable $x$ is an expression of the form $ax^2+bx+c$, where $a$, $b$ and $c$ are constant numbers.

Such a quadratic expression is called a complete square if it takes the form: \begin{align} x^2 +2ax +a^2 &= (x+a)(x+a)\\ &= (x+a)^2 \end{align}

Of course, most quadratic expressions are not complete squares, but we will now see how to write such an expression in a form involving a complete square. The method is called completing the square.

The simplest case is when the coefficient of $x^2$ is $1$, i.e. the expression is of the form $x^2+2ax+b$. In this case, the completed square form is \[(x+a)^2 + (b-a^2)\]

We can show that this is equivalent to the original expression by expanding the brackets

\begin{align} (x+a)^2 + (b-a^2) &= x^2 + 2ax + a^2 + b - a^2 \\ &= x^2 + 2ax + b \end{align}

In short, the method is: halve the $x$ term to get $a$; gather it into a pair of brackets $(x+a)^2$; and then subtract $a^2$ from $b$, leaving you with $(x+a)^2 + (b-a^2)$.

If the coefficient of $x^2$ is some constant $a \neq 1$, then take a factor of $a$ out from each term and proceed as above. \[ax^2 + bx + c = a \left( x^2 + \frac{b}{a}x + \frac{c}{a} \right)\]

Worked Examples

Solution

The coefficient of $x$ is $2$. The constant term in the completed square part is half of that, i.e. $1$. Hence, the completed square form of the expression is

\[(x+1)^2 - 1^2 + 5 = (x+1)^2 + 4\]

Example 2

Express $3x^2-12x+4$ in completed square form.

Solution

This time the coeffiecient of $x^2$ is not $1$. Start by factoring $3$ out of the expression.

\[3x^2-12x+4 = 3\left(x^2 -4x + \frac{4}{3}\right)\]

Now, proceed as above.

\begin{align} 3\left(x^2 -4x +\dfrac{4}{3}\right) &= 3\left((x-2)^2-2^2+\frac{4}{3}\right) \\ &= 3 \left( (x-2)^2 - \frac{8}{3} \right) \\ &=3(x-2)^2-8 \end{align}

Video Examples

Example 1

Prof. Robin Johnson writes $x^2+2x-3$ in completed square form, then shows how this can then be written as a product of two linear factors.

Example 2

Prof. Robin Johnson solves the quadratic equation $2x^2-3x-4=0$ by completing the square.

Maxima and Minima of Quadratics

A quadratic curve has either a maximum or a minimum point, depending on the coefficient of the $x^2$ term.

If the coefficient of the $x^2$ term is positive, the curve has a single minimum point and looks like this:

Conversely if the coefficient of the $x^2$ term is negative, the curve has a single maximum point and looks like this:

Finding the Maximum and Minimum Values

It's possible to find the minimum or maximum of a quadratic curve without differentiating by instead finding the completed square form of the curve's equation.

The general completed square form of a quadratic equation is $q(x) = a(x+r)^2 + s$. Note that $(x+b)^2$ is always positive, so $q(x)$ takes its minimum (or maximum, if $a \lt 0$) value when $x=-r$, and that value is $s$.

Worked Examples
Example 1

Given the quadratic $q(x)=3-4x-x^2$, find its maximum value and the value of $x$ at which this maximum is attained.

Solution

On completing the square, we have $q(x) = -(x+2)^2 + 7$ .

Hence we see that the maximum value is $7$ and this occurs at $x=-2$.

Example 2

Given the quadratic $x^2-6x+7$,find its minimum value and the value of $x$ at which this minimum is attained.

Solution

On completing the square, we have $q(x) = (x-3)^2-2$.

Hence we see that the minimum value is $-2$ and this occurs at $x=3$.

Test Yourself

Test yourself: Numbas test on completing the square

External Resources

Whiteboard maths

More Support

You can get one-to-one support from Maths-Aid.