# The process behind completing the square [duplicate]

What is the process behind transforming $x^2+x+1$ into $(x+\frac12)^2+\frac34$?

Does that same method works for every time I want to transform an expression like $ax^2+bx+c$ into a square like $(a+b)^2$?

We have

$$x^2+x+1$$

and at first we concetrate our attention on $x^2$ and $x$ then

$$x^2+x=\left(x+\frac12\right)^2-\frac14$$

then we adjust for the constant term

$$x^2+x+1=\left(x+\frac12\right)^2-\frac14+1=\left(x+\frac12\right)^2+\frac34$$

This method always works for this kind of expressions.

• I understood the rest, but why the $\frac14$ is negative after the square? Thank you. – Pedro Mar 24 '18 at 15:56
• since $\left(x+\frac12\right)^2=x^2+x+\frac14$ then to obtain $x^2+x$ we consider $\left(x+\frac12\right)^2-\frac14$ – user Mar 24 '18 at 15:58
• Alright, got it. Thank you. – Pedro Mar 24 '18 at 16:02

Step 1. Forget about the $1$ first, what would be $a$ and $b$ such that $$(ax+b)^2=x^2+x+\text{something}?$$

Answer: $a=1$ because of $x^2$, and therefore $b=\frac12$ because of $x$.

Step 2. What would be $c$ such that $$(x+\frac 12)^2+c=x^2+x+1?$$

Answer: $\frac34$ (pretty easy analysis at this point).

As for you last question, yes, this can be done with any quadratic polynomial.

• You're welcome! – Arnaud Mortier Mar 24 '18 at 16:32