How to integrate $\frac{x+2}{x^2+2x+2}$ with the substitution method This is what I got so far:
$$\frac{x+2}{x^2+2x+2} = \frac{x+2}{(x+1)^2+1} = \int \frac{x}{(x+1)^2+1} + 2 \times \int \frac{1}{(x+1)^2+1}$$
I know the last integral $= \arctan(x+1) + c$, where $c$ is a constant, but I don't know how to integrate the first one, i.e $\int \frac{x}{(x+1)^2+1}$.
Thanks for your help.
EDIT: MY SOLUTION
I split the fraction: $\frac{x+1}{x^2+2x+2} + \frac{1}{x^2+2x+2}$
$$\int \frac{x+1}{(x+1)^2+1}\;dx \implies (x+1)^2+1 = u$$
$$\implies \int\frac{(x+1)}{u} \text{ and } \frac{du}{2(x+1)}$$
$$=\frac{1}{2}\int \frac{1}{u}\,du$$
$$=\frac{1}{2}\ln(u)$$
$$=\frac{1}{2}\ln(x^2+2x+2)$$
so finally the last integral $\int \frac{1}{x^2+2x+2}\,dx = \int \frac{1}{(x+1)^2+1}\,dx = \arctan(x+1)$ 
and now the solution = $\frac{1}{2}\ln(x^2+2x+2) + \arctan(x+1) + C$

HINT: You want one of the integrals to integrate to give a logarithmic function. Take this into account when you split up the fractions and you should be fine.
