Question:
Evaluate $\int(x+1)^{2} e^{x} d x$
Solution:
$y=\int\left(x^{2}+2 x+1\right) e^{x} d x$
$y=\int\left(x^{2}+2 x\right) e^{x} d x+\int e^{x} d x$
We know that $\int\left(f(x)+f^{\prime}(x)\right) e^{x} d x=f(x) e^{x}$
Here, $f(x)=x^{2}$ then $f^{\prime}(x)=2 x$
$y=x^{2} e^{x}+e^{x}+c$
$y=\left(x^{2}+1\right) e^{x}+c$