# How do you complete the square for x^2+18x?

May 31, 2015

${\left(x + 9\right)}^{2} = {x}^{2} + 18 x + 81$

In general,

$a {x}^{2} + b x + c = a {\left(x + \frac{b}{2 a}\right)}^{2} + \left(c - {b}^{2} / \left(4 a\right)\right)$

Notice that the term added to $x$ is $\frac{b}{2 a}$

May 31, 2015

For a general form, squared binomial
$\textcolor{w h i t e}{\text{XXXXX}}$${\left(x + a\right)}^{2} = {x}^{2} + 2 a x + {a}^{2}$

So if ${x}^{2} + 18 x$ are the first two terms of a squared binomial
$\textcolor{w h i t e}{\text{XXXXX}}$then, in the general form, $a = 9$ and
$\textcolor{w h i t e}{\text{XXXXX}}$${a}^{2} = {9}^{2} = 81$

Of course, if we are going to add ${9}^{2}$ to the expression ${x}^{2} + 18 x$ we are also going to have to subtract it:
$\textcolor{w h i t e}{\text{XXXXX}}$${x}^{2} + 18 x$
$\textcolor{w h i t e}{\text{XXXXX}}$$= {x}^{2} + 18 x \textcolor{red}{+ {9}^{2}} - \textcolor{b l u e}{{9}^{2}}$
$\textcolor{w h i t e}{\text{XXXXX}}$$= \textcolor{red}{{\left(x + 9\right)}^{2}} \textcolor{b l u e}{- 81}$