# (Highschool Precalculus) Completing the square with R

I am trying to put the following expression $x^2 + 6x + 7$ in the form $(x + r)^2 + s$ so I can complete the square.

I understand the first couple of steps,

$(x^2 + 6x + 7)$

$b =\left(\frac62\right)^2 = 9$

$x^2 + 6x + 9 - 9 + 7$

$(x^2 + 6x + 9) - 9 + 7$

$(x^2 + 6x + 9) - 2$

From this point on I'm not sure what to do to put it in $(x + r)^2$. What is $r?$ Any help is much appreciated.

Also, I have one question last important question:

1) Will this method work for any expression / equation in solving the square?

• Write $x^2+6x+9$ as the square of a linear term. – David Mitra Jan 18 '14 at 11:37

Note that $$x^2+2ax+a^2=(x+a)^2.$$

So, in your case, $$x^2+6x+9=x^2+2\cdot 3x+3^2=(x+3)^2.$$

In general, \begin{align}ax^2+bx+c&=a\left(x^2+\frac{b}{a}x\right)+c\\&=a\left\{x^2+\frac{b}{a}x+\left(\frac{b}{2a}\right)^2-\left(\frac{b}{2a}\right)^2\right\}+c\\&=a\left\{\left(x+\frac{b}{2a}\right)^2-\left(\frac{b}{2a}\right)^2\right\}+c\\&=a\left(x+\frac{b}{2a}\right)^2-a\left(\frac{b}{2a}\right)^2+c.\end{align}

• do you mean $r=-3$? – nadia-liza Jan 18 '14 at 11:39
• Sorry but how did you get r? – Sophia Jan 18 '14 at 11:39
• @Sophia: $r=6/2$. Note that $x^2+2ax+a^2=(x+a)^2$. In other word, $r$ is the half of the coefficient of $x$. – mathlove Jan 18 '14 at 11:46
• @nadia-liza: No. I think $r=3$. – mathlove Jan 18 '14 at 11:55

If you don't understand / remember the algorithm, then ignore the algorithm and simply solve for things.

You want

$$x^2 + 6x + 7 = (x+r)^2 + s$$

so you expand the right hand side and solve for values of $r$ and $s$ that make the two sides equal.

I was taught you half the x coefficient and subtract its square. Eg:

$$x^2+6x+7 = (x+3)^2 - (3)^2+7 = (x+3)^2-2$$

Or in general, $$x^2+bx+c=(ax+\frac{b}{2})^2-(\frac{b}{2})^2+c$$

This works in all cases. If b is negative, then you would get: $$x^2-bx+c=(x-\frac{b}{2})^2-(\frac{b}{2})^2+c$$

Or if the term in front of $x^2$ was a, take a out as a factor and continue from there: $ax^2+bx+c = a(x^2+\frac{bx}{a}+\frac{c}{a})$

You surely know that $(a+b)^2=a^2+2ab+b^2$. Now your problem is to transform $(x^2 + 6x + 7)$ in the form $(x+r)^2+s$ right? We can notice that $(x^2+6x)$ is similar to $a^2+2ab$ in the expansion of $(a+b)^2$ but to complete the expansion we need a value that multiplied by $(2\cdot x)$ give us $6x$ and that value is 3. To complete the expansion we need to square the value (that gives us 9). So we have$$x^2 + 6x + 7=x^2 + 6x + 9 - 9 + 7 = (x^2+6x+9)-2= (x+3)^2-2$$ Your equation written in the form $(x+r)^2+s$

Hope this will help

peterix