# Formula for completing the square?

My math teacher said that this was the formula for completing the square.

Original function: $$ax^2 + bx + c$$ Completed square: $$a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a} + c$$

However, using this formula I'm not getting the same answers that I would get just by determining the stuff myself. Is this correct?

-
If you expand out the second expression and simplify, do you get back $a x^2 + bx +c$? – Srivatsan Oct 28 '11 at 20:39

Note that \begin{align*}a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a} + c&=a\left(x^2+2\left(\frac{b}{2a}\right)x+\left(\frac{b}{2a}\right)^2\right)- \frac{b^2}{4a} + c\\ &=a\left(x^2+\left(\frac{b}{a}\right)x+\frac{b^2}{4a^2}\right)- \frac{b^2}{4a} + c\\ &=\left(ax^2+bx+\frac{b^2}{4a}\right)- \frac{b^2}{4a} + c\\\\ &= ax^2+bx+c \end{align*} so the formula is correct. Try plugging in the numbers $a$, $b$, and $c$ you are using to each step here and seeing where they begin to differ; that will be where your error is.

-

For the polynomial $4x^2+4x+5$ that you mention, I would not use the formula, since it is fairly clear that $4x^2 +4x$ is "almost" $(2x+1)^2$. In fact, $(2x+1)^2=4x^2+4x+1$, so $4x^2+4x+5=(2x+1)^2-1+5=(2x+1)^2+4$.

In general, suppose that $a \ne 0$, and we want to deal with $ax^2+bx+c$. Multiply the expression by $4a$, and to keep things unchanged, divide by $4a$. We get $$ax^2+bx+c=\frac{1}{4a}(4a^2x^2 +4abx +4ac).$$ But $4a^2x+4abx$ is almost the square of $2ax+b$. In fact, $4a^2x^2+4abx=(2ax+b)^2-b^2$. It follows that $$4a^2x^2+4abx+4ac=(2ax+b)^2-(b^2-4ac),$$ so $$ax^2+bx+c=\frac{1}{4a}\left((2ax+b)^2-(b^2-4ac)\right).$$ The formula is useful as is, and more pleasant to work with than the formula of the post. We can transform it to look like that formula by multiplying the top and bottom of the front by $a$, and using the fact that $\frac{1}{4a^2}(2ax+b)^2=\left(x+\frac{b}{2a}\right)^2$.

Comment: If we want to derive the Quadratic Formula, we don't need to bother with dividing by $4a$, for $ax^2+bx+c=0$ iff $4a^2+4abx+4ac=0$. Complete the square like above. We get $$ax^2+bx+c=0 \qquad\text{if and only if}\quad (2ax+b)^2=b^2-4ac,$$ and we are a couple of easy steps away from the Quadratic Formula.

Important: One should not try to remember a formula for completing the square. What one needs to understand is the process, the idea. Students, particularly those blessed (?) with good memories, find that throughout high school they can achieve easy success by memorizing formulas. Finding out what's really going on may in the short term look like more work, but it will last.

-
This to me is one of those instances where the algorithm is easier to remember than the formula that results when the algorithm is applied symbolically. – J. M. Oct 29 '11 at 1:45
Strongly agree. Saw your comment when I went to add a comment sort of to that effect. – André Nicolas Oct 29 '11 at 1:56

I usually find that completing the square by hand for each example is better than just using the formula.

For your example, $$4x^2 + 4x + 5 = 4\left(x^2 + x + \frac{5}{4}\right).$$ This is of the form $x^2 + x + \mathrm{const}$, so you to find a number $a$ such that $(x+a)^2 = x^2 + x + \mathrm{const}$. The solution is $a=\frac{1}{2}$, giving $$4x^2 + 4x + 5 = 4\left(x+\frac{1}{2}\right)^2 + \mathrm{const}$$ Expanding the RHS, you find that the constant is $4$, so the whole expression is $$4x^2 + 4x + 5 = 4\left(x + \frac{1}{2} \right)^2 + 4 = (2x + 1)^2 + 4$$

-

Let me derive it for you,

$$ax^2+bx+c= a \left( x^2+\frac{b}{a} x +\frac ca \right) = a\left(x^2+2\frac{b}{2a} x + \left( \frac b{2a} \right) ^2 - \left( \frac b{2a} \right) ^2+\frac ca \right)$$ $$= a \left\{ \left(x+\frac{b}{a}\right)^2 - \frac{(b^2-4ac)}{4a^2} \right\} = a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a} + c$$

Btw how are you applying this?

-
The equation in question is $$4x^2 + 4x + 5$$ I got $$4\left(x+\frac{1}{2}\right)^2-1$$ Wolfram got $$\left(2x+1\right)^2 + 4$$ Why? – Yep Oct 28 '11 at 20:53
@Yep: Your answer is incorrect, because $$4\left(x+\frac{1}{2}\right)^2-1=4\left(x^2+x+\frac{1}{4}\right)-1=(4x^2+4x+1)-‌​1=4x^2+4x.$$ Wolfram is correct, because $$\left(2x+1\right)^2 + 4=((2x)^2+2(2x)(1)+(1)^2)+4=(4x^2+4x+1)+4=4x^2+4x+5$$ – Zev Chonoles Oct 28 '11 at 20:55
I edited the post. I forgot to write that in. ;) – Yep Oct 28 '11 at 20:56
@Yep: I've now edited my post :) – Zev Chonoles Oct 28 '11 at 20:58
For the equation : $4x^2 + 4x + 5$,$a=4,b=4,c=5$;So you should get $$4\left(x + \frac{1}{2}\right)^2 - \frac{16}{16} + 5 \Rightarrow ...$$ – Quixotic Oct 28 '11 at 21:01