Need help integrating $\int e^x(\frac{x+2}{x+4})^2 dx $ I have simplified the problem a bit using integration by parts, with $u = e^x(x+2)^2$ and $v = 1/(x+4)^2$ but I'm then stuck with how to integrate this:
$$\int\frac{e^x(x^2+4x+8)}{x+4}dx. $$
I've considered substituting $t = e^x$, but this doesn't seem to make the problem any easier.

\begin{align*}\int e^x\left(\frac{x+2}{x+4}\right)^2\,\mathrm dx&=\int\frac1{(x+4)^2}e^x(x+2)^2\,\mathrm dx\\&=-\frac{e^x(x+2)^2}{x+4}+\int e^x(x+2)\,\mathrm dx\\&=-\frac{e^x(x+2)^2}{x+4}+e^x(x+2)-\int e^x\,\mathrm dx\\&=-\frac{e^x(x+2)^2}{x+4}+e^x(x+1)\\&=\frac{xe^x}{x+4}.\end{align*}
