In this explainer, we will learn how to complete the square and use it to solve quadratic equations.

We already know how to factor a quadratic expression into linear factors and how to solve a quadratic equation using the quadratic formula. We will now learn how to solve a quadratic by another method, that is, completing the square.

Consider the expression

Since both terms have a factor of , we could immediately factor this as ; this would give us the solutions to the equation as and . However, we are going to do something different. We want to rearrange the expression so that it has only one term containing rather than two. The form we are aiming for is where , , and are constants to be determined. To do this, we take the binomial and square it: . If we expand this out, we get

Notice that the first two terms of this match our starting expression. So, to make it equal, we just need to subtract the constant:

### How To: Completing the Square for Expressions of the Form π₯^{2} + ππ₯

To complete the square for expressions of the form we take and subtract the square :

We have seen algebraically that the expressions are equivalent. This is reflected in the geometry, where represents the area of a rectangle with side lengths and , while the expression represents the area of a square of side length minus the area of a βsmallβ square of side length .

This diagram illustrates the situation when ; a similar diagram can be drawn illustrating the situation when ; try it!

Although factoring is the quickest way to solve equations of the form , we can also solve them by completing the square. It will be useful to see the procedure here. Suppose we are given . Then, converting the left-hand expression with two terms containing to an expression with one term containing and a constant term allows us to solve the equation by moving the constant to the right-hand side and extracting the square roots. So, yields or .

### Example 1: Writing a Quadratic Expression with No Constant Term in a Given Form by Completing the Square

Given that , what are the values of and ?

### Answer

We want to complete the square on . To do this, we first halve the coefficient of : . We then write down minus the square of :

The values of and are therefore and .

We have seen how to complete the square for quadratics with no constant term and -coefficient equal to 1. Let us now look at the case when a constant term is present. Consider the expression

As before, we first halve the coefficient of , , and consider the expression :

We see that the first two terms here match the first two terms of the original quadratic. In order to make the constant terms match, we subtract the βerrorβ of and add on the constant term from our original expression:

### How To: Completing the Square for Expressions of the Form
π₯^{2} + ππ₯ + π

The procedure for completing the square for a quadratic of the form is as follows.

- Halve the -coefficient, .
- Write down .
- Subtract the error .
- Add on the constant term .

Thus, we have, in general,

### Example 2: Completing the Square for a Quadratic Expression

Write the equation in completed square form.

### Answer

We first halve the -coefficient and write down

We now subtract the error and add on the constant term from the original equation, which is :

So, the equation, written in completed square form, is .

So, suppose we have a quadratic equation, say,

As mentioned above, we can use the technique of completing the square to solve the equation. First, complete the square:

We can now move the constant term over to the right-hand side, and take square roots giving us the solutions and .

The technique of completing the square is particularly useful for solving equations of the form

With a bit of practice, you should be able to complete the square on the left-hand side in your head as without too much difficulty and then shift the constant over to the right. When the equation is βniceβ (which basically means here that is even), this method is usually easier and faster than either factoring or using the quadratic formula.

### Example 3: Solving a Quadratic Equation by Completing the Square

By completing the square, solve the equation .

### Answer

We will complete the square on the left-hand side. The coefficient of is , so we halve it and write

Now, taking the square root of both sides, we get giving us the solutions of and .

The most general form of a quadratic expression is where the -term has a coefficient possibly not equal to 1. The easiest way to complete the square with such an expression is to first factor out the leading coefficient to avoid having to deal with in our expression. We find and then complete the square with the contents of the parentheses as explained above. We have and

### Example 4: Writing a Quadratic Equation with Variable Coefficients in a Given Form by Completing the Square

Write the equation in the form .

### Answer

We have here a quadratic polynomial with leading coefficient 3. Since this polynomial appears in the equation , we may first divide both sides by the leading coefficient to reduce it to the case where the leading coefficient is 1:

We now divide the -coefficient by two, , and write down

From this expression, we want to subtract the error term and add on the constant term :

We have and so

It is important to note that when we are dealing with a quadratic
*equation*, say, , then the leading
factor of in
may
simply be discarded at this stage (just divide both sides by
).

### Example 5: Solving a Nonmonic Quadratic Equation by Rearranging and Completing the Square

Solve the equation by completing the square.

### Answer

The equation has an -coefficient of and is not in the form , so let us first reorder the terms:

Then, we factor out that leading coefficient of :

Because we are dealing with an *equation* here, we may at this point
divide both sides by , leaving us with the equation
to be solved. Let us complete the square. First we divide the
-coefficient by 2,
, and write down

From this, we subtract the error and add on the constant term :

Finally, to solve the equation, we move all of the constant terms over to the right-hand side and extract the square roots: which gives us the solutions of and . We can simplify these solutions slightly by rationalizing the denominator of . Observe that is a perfect square, and so

Therefore, we give our final answers as and .

Given a general quadratic equation we can write the expression on the left-hand side in completed square form as for the equation

Dividing both sides by , and moving constant terms to the right-hand side, we have

Taking square roots, and subtracting from both sides, we have

We can simplify the expression under the square root sign:

And so

Putting this all together, we have which is nothing other than the familiar quadratic formula.

Let us finish by recapping a few important concepts from this explainer.

### Key Points

- We can put quadratic expressions of the form with no constant term into the completed square form
- We can put quadratic expressions of the form into the completed square form
- We can put general quadratic expressions into completed square form by first factoring out the leading coefficient and then completing the square on the contents of the parentheses.
- We can solve quadratic equations by first dividing both sides by to get a quadratic with leading coefficient 1 on the left-hand side, and then completing the square: Finally, we move all the constant terms to the right-hand side and take square roots, to get the solutions