How to linearize a square graph

Filling out the square calculator

What does it mean to complete the square? Well the idea is to have the square of something. Whenever you have a quadratic expression of the form \ (ax ^ 2 + bx + c \), you want it to be the "square of something".

When you analyze the expression, the only square you see is the part \ (a x ^ 2 \) that contains the square of \ (x \), but then you have other things besides the square. Mathematically, it is always possible to put a quadratic expression of the form \ (ax ^ 2 + bx + c \) as "the square of something", but we might need to add a constant.

When this constant is zero we sometimes get what is called a Perfect square .

Completing the squares is simply the act of putting a quadratic expression \ (ax ^ 2 + bx + c \) into the shape of the square of a simple expression plus possibly a constant. The process is straightforward and consists of several steps.

How do you complete the square?

Step 1: Make sure that the expression you pass is quadratic and that a non-zero coefficient multiplies the term \ (x ^ 2 \). If it doesn't, you will not be able to complete this procedure.

Step 2: After you have a correct quadratic term \ (ax ^ 2 + bx + c \), you have to subtract \ (a \) (the term that multiplies \ (x ^ 2 \)). If \ (a = 1 \) then leave it as is.

\ [ax ^ 2 + bx + c = \ displaystyle a \ left (x ^ 2 + \ frac {b} {a} x + \ frac {c} {a} \ right) \]

Step 3: Now we need to look at the term in the brackets (or the original term if \ (a = 1 \)). Notice that for a constant \ (d \) we have this \ ((x + d) ^ 2 = x ^ 2 + 2dx + d ^ 2 \). So let's watch that

\ [ax ^ 2 + bx + c = \ displaystyle a \ left (x ^ 2 + \ frac {b} {a} x + \ frac {c} {a} \ right) = \ displaystyle a \ left (x ^ 2 + 2 \ left (\ frac {b} {2a} \ right) x + \ frac {c} {a} \ right) \]

The term \ (2 \ left (\ frac {b} {2a} \ right) x \) in the above expression is the \ (d \) in \ ((x + d) ^ 2 = x ^ 2 + 2dx + d ^ 2 \) very similar. So we can actually do it

\ [ax ^ 2 + bx + c = \ displaystyle a \ left (x ^ 2 + \ frac {b} {a} x + \ frac {c} {a} \ right) = \ displaystyle a \ left (x ^ 2 + 2 \ left (\ frac {b} {2a} \ right) x + \ frac {c} {a} \ right) \] \ [= \ displaystyle a \ left (x ^ 2 + 2 \ left (\ frac {b} {2a} \ right) x + \ left (\ frac {b} {2a} \ right) ^ 2 - \ left (\ frac {b} {2a} \ right) ^ 2 + \ frac {c } {a} \ right) \] \ [= \ displaystyle a \ left (\ left (x + \ frac {b} {2a} \ right) ^ 2 - \ left (\ frac {b} {2a} \ right ) ^ 2 + \ frac {c} {a} \ right) \] \ [= \ displaystyle a \ left (x + \ frac {b} {2a} \ right) ^ 2 - \ frac {b ^ 2} { 4a} + c \]

Completion of the quadratic examples

Consider the expression: \ (2x ^ 2 + 2x + 1 \). First we factor 2 out:

\ [2x ^ 2 + 2x + 1 = \ displaystyle 2 \ left (x ^ 2 + x + \ frac {1} {2} \ right) \]

We can either memorize the formula given above, or you can follow the procedure for "forcing" the square. I believe the latter is the best option as you can definitely forget the formula, but you won't forget the procedure once you learn it. So let's look at the term \ (x \) and force the 2 in front of it. So we get

\ [2x ^ 2 + 2x + 1 = \ displaystyle 2 \ left (x ^ 2 + x + \ frac {1} {2} \ right) = \ displaystyle 2 \ left (x ^ 2 + 2 \ left (\ frac {1} {2} \ right) x + \ frac {1} {2} \ right) \]

Now look at the term in the bracket to the left of \ (x \). We square the term and add it and subtract it: \ (\ displaystyle \ left (\ frac {1} {2} \ right) ^ 2 - \ left (\ frac {1} {2} \ right) ^ 2 \) , so we're essentially adding 0 so that the expression doesn't change:

\ [2x ^ 2 + 2x + 1 = \ displaystyle 2 \ left (x ^ 2 + x + \ frac {1} {2} \ right) = \ displaystyle 2 \ left (x ^ 2 + 2 \ left (\ frac {1} {2} \ right) x + \ frac {1} {2} \ right) \] \ [= \ displaystyle 2 \ left (x ^ 2 + 2 \ left (\ frac {1} {2} \ right) x + \ left (\ frac {1} {2} \ right) ^ 2 - \ left (\ frac {1} {2} \ right) ^ 2 + \ frac {1} {2} \ right) \ ]

Now we can identify and get the first three terms as a perfect square:

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

Why is it called the why?

You may be wondering why the procedure for filling in the square is called as filling in the square? Well I mentioned it at the beginning. We're trying to get a square expression and rewrite it as the "square of something". It does this by adding the correct constant so that we literally "complete" the square. By adding (and subtracting) this constant, we get a perfect square plus a constant that makes it possible to find that "square of something" that we were looking for

Solve quadratic equations by completing the square

Interestingly, completing the square is equivalent to solving a quadratic equation. Indeed, if we want to solve

\ [ax ^ 2 + bx + c = 0 \]

We now know that we can complete the square to get:

\ [ax ^ 2 + bx + c = \ displaystyle a \ left (x + \ frac {b} {2a} \ right) ^ 2 - \ frac {b ^ 2} {4a} + c \]

We get that solving the quadratic equation is the same as solving it

\ [ax ^ 2 + bx + c = \ displaystyle a \ left (x + \ frac {b} {2a} \ right) ^ 2 - \ frac {b ^ 2} {4a} + c = 0 \]

So then

\ [\ displaystyle a \ left (x + \ frac {b} {2a} \ right) ^ 2 - \ frac {b ^ 2} {4a} + c = 0 \] \ [\ Rightarrow a \ left (x + \ frac {b} {2a} \ right) ^ 2 = \ frac {b ^ 2} {4a} - c \] \ [\ Rightarrow \ left (x + \ frac {b} {2a} \ right) ^ 2 = \ frac {b ^ 2-4ac} {4a ^ 2} \] \ [\ Rightarrow x + \ frac {b} {2a} = \ pm \ sqrt {\ frac {b ^ 2-4ac} {4a ^ 2 }} \] \ [\ Rightarrow x = - \ frac {b} {2a} \ pm \ sqrt {\ frac {b ^ 2-4ac} {4a ^ 2}} \] \ [\ Rightarrow x = \ frac { -b \ pm \ sqrt {b ^ 2-4ac}} {2a} \]

So, completing the square to solve a quadratic equation is exactly the same as using the traditional quadratic formula.

Other related calculators

You may be interested in our quadratic equation calculator if you want to calculate roots using the traditional quadratic equation formula.