We are given the integral: \[ \int \frac{x e^x}{(1 + x)^2} \, dx \] \textbf{Step 1: Use substitution}\\ Let \( u = 1 + x \), so that \( du = dx \), and \( x = u - 1 \). The integral becomes: \[ \int \frac{(u - 1) e^{u - 1}}{u^2} \, du \] \textbf{Step 2: Simplify the expression}\\ Since \( e^{u - 1} = \frac{e^u}{e} \), the integral becomes: \[ \frac{1}{e} \int \left( \frac{e^u}{u} - \frac{e^u}{u^2} \right) \, du \] \textbf{Step 3: Solve the integrals}\\ The integral of \( \frac{e^u}{u^2} \) is \( -\frac{e^u}{u} \), and after simplification, the result is: \[ \frac{e^x}{1 + x} + c \]
The correct answer is (D) : \(\frac{e^x}{1+x}+c\).