Answer
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{-xe^{x}}{x+1} + e^{x} +c = \frac{e^{x}}{x+1} +c $
Work Step by Step
Integrate by parts using $\int udv = uv - \int vdu$
$u = xe^{x}$
$du = xe^{x}+e^{x}dx$
$dv = \frac{1}{(x+1)^2}dx$
$v = -\frac{1}{x+1}$
Now substitute into the formula:
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{-xe^{x}}{x+1} - \int-\frac{xe^{x}+e^{x}}{x+1}dx$
Simplify:
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{-xe^{x}}{x+1} + \int\frac{(x+1)e^{x}}{x+1}dx$
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{-xe^{x}}{x+1} + \int e^{x} dx$
Integrate:
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{-xe^{x}}{x+1} + e^{x} +c$
Simplify by joining the two terms into a fraction (optional):
$\int\frac{xe^{x}}{(x+1)^2}dx = \frac{e^{x}}{x+1} +c$