Question:
Evaluate the following integrals: $\int \frac{x^{2}+3 x+1}{(x+1)^{2}} d x$
Solution:
$\operatorname{Let} I=\int \frac{x^{2}+3 x+1}{(x+1)^{2}} d x$
Substituting $x+1=t \Rightarrow d x=d t$
$\Rightarrow I=\int \frac{(t-1)^{2}+3(t-1)+1}{t^{2}} d t$
$\Rightarrow I=\int \frac{t^{2}-2 t+1+3 t-3+1}{t^{2}} d t$
$\Rightarrow I=\int \frac{t^{2}+t-1}{t^{2}} d t$
$\Rightarrow I=\int\left(1+\frac{1}{t}-\frac{1}{t^{2}}\right) d t$
$\Rightarrow \mathrm{I}=\mathrm{t}+\log |\mathrm{t}|-\frac{1}{\mathrm{t}}+\mathrm{c}$
$\Rightarrow I=(x+1)+\log |x+1|+\frac{1}{x+1}+c$
Therefore, $\int \frac{x^{2}+3 x+1}{(x+1)^{2}} d x=(x+1)+\log |x+1|+\frac{1}{x+1}+c$