Evaluate an indefinite integral Find the value of 
$$\int{\frac{x^2e^x}{(x+2)^2}} dx$$
My Attempt: I tried to arrange the numerator as follows:
$$ e^xx^2 =  e^x(x+2-2)^2 $$ but that didn't help.
Any guidance on this problem will be very helpful.

Another method:
\begin{align}
\int \frac{x^2 \, e^{x}}{(x+2)^2} \, dx &= - \int x^2 \, e^{x} \, \frac{d}{dx} \left(\frac{1}{x+2}\right) \, dx \\
&= - \left[ \frac{x^2 \, e^{x}}{x + 2} \right] + \int x(x+2) \, e^{x} \cdot \frac{1}{x+2} \, dx \\
&= - \frac{x^2 \, e^{x}}{x + 2} + \int x \, e^{x} \, dx \\
&= - \frac{x^2 \, e^{x}}{x + 2} + (x-1) \, e^{x} + c_{0}\\
&= \left(\frac{x-2}{x+2} \right) \, e^{x} + c_{0}. 
\end{align}
