Example 4. Find the integral $\int \frac{x+2}{x^{2}+2 x+5} d x$.
Solution. This is an integral of the form (4.21). By transforming the quadratic trinomial and changing the variable to $x+1=t$, we find

$$
\begin{gathered}
\int \frac{x+2}{x^{2}+2 x+5} d x=\int \frac{x+2}{\left(x^{2}+2 x+1\right)+4} d x=\int \frac{(x+1)+1}{(x+1)^{2}+4} d x= \\
=\int \frac{x+1}{(x+1)^{2}+2^{2}} d(x+1)+\int \frac{d(x+1)}{(x+1)^{2}+2^{2}}= \\
=\frac{1}{2} \int \frac{d\left[(x+1)^{2}+2^{2}\right]}{(x+1)^{2}+2^{2}}+\int \frac{d(x+1)}{(x+1)^{2}+2^{2}}=\frac{1}{2} \ln \left[(x+1)^{2}+2^{2}\right]+ \\
+\frac{1}{2} \operatorname{arctg} \frac{x+1}{2}+C=\frac{1}{2} \ln \left(x^{2}+2 x+5\right)+\frac{1}{2} \operatorname{arctg} \frac{x+1}{2}+C .
\end{gathered}
$$