\(\displaystyle 9x^2+12x+7\)

Can I do

\(\displaystyle (9x+12x+36)-29\)?

No, the coefficient of \(\displaystyle x^2\) needs to be \(\displaystyle 1\).

So what you need to do is...

\(\displaystyle 9x^2 + 12x + 7 = 9\left(x^2 + \frac{4}{3}x + \frac{7}{9}\right)\)

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

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

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

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

\(\displaystyle = 9\left(x + \frac{2}{3}\right)^2 + 3\).