The portal has been deactivated. Please contact your portal admin.

Lesson Explainer: Completing the Square Mathematics

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 π‘₯+8π‘₯.

Since both terms have a factor of π‘₯, we could immediately factor this as π‘₯+8π‘₯=π‘₯(π‘₯+8); this would give us the solutions to the equation π‘₯+8π‘₯=0 as π‘₯=0 and π‘₯=βˆ’8. 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 π‘₯+4 and square it: (π‘₯+4). If we expand this out, we get (π‘₯+4)=π‘₯+8π‘₯+16.

Notice that the first two terms of this match our starting expression. So, to make it equal, we just need to subtract the constant: (π‘₯+4)βˆ’16=π‘₯+8π‘₯+16βˆ’16=π‘₯+8π‘₯.

How To: Completing the Square for Expressions of the Form π‘₯2 + 𝑏π‘₯

To complete the square for expressions of the form π‘₯+𝑏π‘₯, we take ο€½π‘₯+𝑏2ο‰οŠ¨ and subtract the square 𝑏2ο‰οŠ¨: π‘₯+𝑏π‘₯=ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2.

We have seen algebraically that the expressions π‘₯(π‘₯+𝑏)=π‘₯+𝑏π‘₯=ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2ο‰οŠ¨οŠ¨οŠ¨ are equivalent. This is reflected in the geometry, where π‘₯(π‘₯+𝑏) represents the area of a rectangle with side lengths π‘₯ and π‘₯+𝑏, while the expression ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2ο‰οŠ¨οŠ¨ represents the area of a square of side length π‘₯+𝑏2 minus the area of a β€œsmall” square of side length 𝑏2.

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

Although factoring π‘₯+𝑏π‘₯=π‘₯(π‘₯+𝑏) is the quickest way to solve equations of the form π‘₯+𝑏π‘₯=0, we can also solve them by completing the square. It will be useful to see the procedure here. Suppose we are given π‘₯+8π‘₯=0. 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, π‘₯+8π‘₯=0(π‘₯+4)βˆ’16=0(π‘₯+4)=16π‘₯+4=Β±4 yields π‘₯=βˆ’4βˆ’4=βˆ’8 or π‘₯=4βˆ’4=0.

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

Given that π‘₯βˆ’10π‘₯=(π‘₯+𝑝)+π‘žοŠ¨οŠ¨, what are the values of 𝑝 and π‘ž?


We want to complete the square on π‘₯βˆ’10π‘₯. To do this, we first halve the coefficient of π‘₯: βˆ’102=βˆ’5. We then write down (π‘₯βˆ’5) minus the square of (βˆ’5): (π‘₯βˆ’5)βˆ’(βˆ’5)=(π‘₯βˆ’5)βˆ’25.

The values of 𝑝 and π‘ž are therefore 𝑝=βˆ’5 and π‘ž=βˆ’25.

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 π‘₯+12π‘₯βˆ’4.

As before, we first halve the coefficient of π‘₯, 122=6, and consider the expression (π‘₯+6): (π‘₯+6)=π‘₯+12π‘₯+36.

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 36=ο€Ό122 and add on the constant term from our original expression: (π‘₯+6)βˆ’36+(βˆ’4)=π‘₯+12π‘₯+36βˆ’36βˆ’4(π‘₯+6)βˆ’40=π‘₯+12π‘₯βˆ’4.

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.

  1. Halve the π‘₯-coefficient, 𝑏2.
  2. Write down ο€½π‘₯+𝑏2ο‰οŠ¨.
  3. Subtract the error 𝑏2ο‰οŠ¨.
  4. Add on the constant term 𝑐.

Thus, we have, in general, π‘₯+𝑏π‘₯+𝑐=ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2+𝑐.

Example 2: Completing the Square for a Quadratic Expression

Write the equation π‘₯+6π‘₯βˆ’3=0 in completed square form.


We first halve the π‘₯-coefficient 62=3 and write down (π‘₯+3).

We now subtract the error 3=9 and add on the constant term from the original equation, which is βˆ’3: (π‘₯+3)βˆ’9βˆ’3=π‘₯+6π‘₯+9βˆ’9βˆ’3=π‘₯+6π‘₯βˆ’3=0.

So, the equation, written in completed square form, is (π‘₯+3)βˆ’12=0.

So, suppose we have a quadratic equation, say, π‘₯+12π‘₯βˆ’4=0.

As mentioned above, we can use the technique of completing the square to solve the equation. First, complete the square: π‘₯+12π‘₯βˆ’4=(π‘₯+6)βˆ’36βˆ’4=(π‘₯+6)βˆ’40.

We can now move the constant term βˆ’40 over to the right-hand side, (π‘₯+6)βˆ’40=0(π‘₯+6)=40, and take square roots π‘₯+6=±√40, giving us the solutions π‘₯=βˆ’6+√40 and π‘₯=βˆ’6βˆ’βˆš40.

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 ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2ο‰οŠ¨οŠ¨ 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 π‘₯βˆ’π‘₯=34.


We will complete the square on the left-hand side. The coefficient of π‘₯ is βˆ’1, so we halve it and write ο€Όπ‘₯βˆ’12οˆβˆ’ο€Όβˆ’12=34ο€Όπ‘₯βˆ’12οˆβˆ’14=34ο€Όπ‘₯βˆ’12=1.

Now, taking the square root of both sides, we get π‘₯βˆ’12=Β±1, giving us the solutions of π‘₯=12+1=32 and π‘₯=12βˆ’1=βˆ’12.

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 π‘₯+π‘π‘Žπ‘₯+π‘π‘Ž=ο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘ŽοŠ¨οŠ¨οŠ¨ and π‘Žπ‘₯+𝑏π‘₯+𝑐=π‘Žο€Ώο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘Žο‹.

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

Write the equation 3π‘₯+𝑏π‘₯βˆ’1=0 in the form (π‘₯+𝑝)=π‘žοŠ¨.


We have here a quadratic polynomial with leading coefficient 3. Since this polynomial appears in the equation 3π‘₯+𝑏π‘₯βˆ’1=0, we may first divide both sides by the leading coefficient to reduce it to the case where the leading coefficient is 1: 3π‘₯+𝑏π‘₯βˆ’1=0π‘₯+𝑏3π‘₯βˆ’13=0.

We now divide the π‘₯-coefficient by two, 𝑏3Γ·2=𝑏6, and write down ο€½π‘₯+𝑏6.

From this expression, we want to subtract the error term 𝑏6=𝑏36 and add on the constant term βˆ’13: ο€½π‘₯+𝑏6ο‰βˆ’π‘36+ο€Όβˆ’13=ο€½π‘₯+𝑏6ο‰βˆ’π‘36βˆ’1236=ο€½π‘₯+𝑏6ο‰βˆ’π‘+1236.

We have ο€½π‘₯+𝑏6ο‰βˆ’π‘+1236=0, and so ο€½π‘₯+𝑏6=𝑏+1236.

It is important to note that when we are dealing with a quadratic equation, say, π‘Žπ‘₯+𝑏π‘₯+𝑐=0, then the leading factor of π‘Ž in π‘Žο€½π‘₯+π‘π‘Žπ‘₯+π‘π‘Žο‰=0 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 15π‘₯+10βˆ’3π‘₯=0 by completing the square.


The equation 15π‘₯+10βˆ’3π‘₯=0 has an π‘₯-coefficient of βˆ’3 and is not in the form π‘Žπ‘₯+𝑏π‘₯+𝑐=0, so let us first reorder the terms: 15π‘₯+10βˆ’3π‘₯=0βˆ’3π‘₯+15π‘₯+10=0.

Then, we factor out that leading coefficient of βˆ’3: βˆ’3π‘₯+15π‘₯+10=0βˆ’3ο€Όπ‘₯βˆ’5π‘₯βˆ’103=0.

Because we are dealing with an equation here, we may at this point divide both sides by βˆ’3, leaving us with the equation π‘₯βˆ’5π‘₯βˆ’103=0 to be solved. Let us complete the square. First we divide the π‘₯-coefficient by 2, βˆ’5Γ·2=βˆ’52, and write down ο€Όπ‘₯βˆ’52.

From this, we subtract the error ο€Όβˆ’52=254 and add on the constant term βˆ’103: π‘₯βˆ’5π‘₯βˆ’103=ο€Όπ‘₯βˆ’52οˆβˆ’254βˆ’103=0.

Finally, to solve the equation, we move all of the constant terms over to the right-hand side and extract the square roots: ο€Όπ‘₯βˆ’52οˆβˆ’254βˆ’103=0ο€Όπ‘₯βˆ’52=254+103ο€Όπ‘₯βˆ’52=11512π‘₯βˆ’52=Β±ο„ž11512, which gives us the solutions of π‘₯=52+ο„ž11512 and π‘₯=52βˆ’ο„ž11512. We can simplify these solutions slightly by rationalizing the denominator of ο„ž11512. Observe that 12Γ—3=36 is a perfect square, and so ο„ž11512=ο„ž115Γ—312Γ—3=ο„ž34536=√3456.

Therefore, we give our final answers as π‘₯=52+√3456 and π‘₯=52βˆ’βˆš3456.

Given a general quadratic equation π‘Žπ‘₯+𝑏π‘₯+𝑐=0, we can write the expression on the left-hand side in completed square form as π‘Žπ‘₯+𝑏π‘₯+𝑐=π‘Žο€Ώο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘Žο‹, for the equation π‘Žο€Ώο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘Žο‹=0.

Dividing both sides by π‘Ž, ο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘Ž=0, and moving constant terms to the right-hand side, we have ο€½π‘₯+𝑏2π‘Žο‰=𝑏2π‘Žο‰βˆ’π‘π‘Ž.

Taking square roots, π‘₯+𝑏2π‘Ž=Β±ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž, and subtracting 𝑏2π‘Ž from both sides, we have π‘₯=βˆ’π‘2π‘ŽΒ±ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž.

We can simplify the expression under the square root sign: 𝑏2π‘Žο‰βˆ’π‘π‘Ž=𝑏4π‘Žβˆ’π‘π‘Ž=𝑏4π‘Žβˆ’4π‘Žπ‘4π‘Ž=π‘βˆ’4π‘Žπ‘4π‘Ž.

And so ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž=ο„žπ‘βˆ’4π‘Žπ‘4π‘Ž=βˆšπ‘βˆ’4π‘Žπ‘2π‘Ž.

Putting this all together, we have π‘₯=βˆ’π‘2π‘ŽΒ±ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž=βˆ’π‘2π‘ŽΒ±βˆšπ‘βˆ’4π‘Žπ‘2π‘Ž=βˆ’π‘Β±βˆšπ‘βˆ’4π‘Žπ‘2π‘Ž, 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 π‘₯+𝑏π‘₯=ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2.
  • We can put quadratic expressions of the form π‘₯+𝑏π‘₯+π‘οŠ¨ into the completed square form π‘₯+𝑏π‘₯+𝑐=ο€½π‘₯+𝑏2ο‰βˆ’ο€½π‘2+𝑐.
  • 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 π‘Žπ‘₯+𝑏π‘₯+𝑐=0 by first dividing both sides by π‘Ž to get a quadratic with leading coefficient 1 on the left-hand side, π‘₯+π‘π‘Žπ‘₯+π‘π‘Ž=0, and then completing the square: ο€½π‘₯+𝑏2π‘Žο‰βˆ’ο€½π‘2π‘Žο‰+π‘π‘Ž=0. Finally, we move all the constant terms to the right-hand side and take square roots, ο€½π‘₯+𝑏2π‘Žο‰=𝑏2π‘Žο‰βˆ’π‘π‘Žπ‘₯+𝑏2π‘Ž=Β±ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž, to get the solutions π‘₯=βˆ’π‘2π‘ŽΒ±ο„Ÿο€½π‘2π‘Žο‰βˆ’π‘π‘Ž=βˆ’π‘Β±βˆšπ‘βˆ’4π‘Žπ‘2π‘Ž.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.