# Factoring polynomials - slightly odd case

I have tried to understand the last step in this question, but I don't quite see the logic

Factor $$x^2+4x+4-9y^2$$

The first thing I thought was that I could factor by grouping, however this is not successful. So, the next thing I tried to do was factor the

$$x^2+4x+4$$ part to get $$(x+2)^2-9y^2$$

Then factor out the common terms in the y-portion:

$$(x+2)^2-(3y)^2$$ But this is as far as I get. I eventually looked up the answer:

$$(x+2-3y)(x+2+3y)$$Is this some difference distributive rule?

-
$A^2 - B^2 = (A-B)(A+B)$ – Will Jagy Apr 28 '12 at 3:52
Or $\rm\ X^2 = B^2\iff X = \pm B\$ and these roots yield the factorization $$\rm X^2 - B^2\ =\ (X-B)\:(X+B)$$ which works even if you have no knowledge of difference of squares factorization. – Bill Dubuque Apr 28 '12 at 4:19

You are probably familiar with the "difference of squares" rule: $$a^2-b^2=(a-b)(a+b).$$ Note that your situation with $(x+2)^2-(3y)^2$ is just a difference of squares, where we have $a=x+2$ and $b=3y$. Thus, we get the factorization $$(x+2-3y)(x+2+3y).$$
The difference of squares rule can be proven by repeated use of the distributive property: \begin{align*}(a-b)(a+b)&=((a-b)\times a)+((a-b)\times b)\\&=(a^2-ba)+(ab-b^2)\\&=a^2-ab+ab-b^2\\&=a^2-b^2\end{align*}