<s>[INST] Solve $ \int {\frac {(x+1)dx}{(x^2+x+2)(x^2+4x+5)}} $ $$ \int {\frac {(x+1)dx}{(x^2+x+2)(x^2+4x+5)}} $$
I know that the answer is $\frac{2\sqrt{7}}{21} arctg \frac {2x+1}{\sqrt{7}}-\frac{1}{3}arctg(x+2)+C$, but I have no idea what to do.
 [/INST] We have: $$ \int {\frac {(x+1)dx}{(x^2+x+2)(x^2+4x+5)}} $$
$$(x^2+x+2):$$
$$\bigtriangleup = 1-4*2=-7$$
$$(x^2+4x+5):$$
$$\bigtriangleup = 16-4*5=-4$$
So: $$\frac{x+1}{(x^2+x+2)(x^2+4x+5)} = \frac{ax+b}{ x^2+x+2} +\frac{cx+d}{x^2+4x+5}$$
$$ x+1= (ax+b)(x^2+4x+5)+(cx+d)(x^2+x+2)$$
$$X+1= ax^3+4Ax^2+5ax+bx^2+4bx+5b+cx^3+cx^2+2cx+dx^2+dx+2d$$
$$\begin{cases}
0=a+c \\
0=4a+b+c+d \\
1=5a+4b+2c+d\\
1=5b+2d
\end{cases}$$
$$\begin{cases}
a=0\\
b=\frac{1}{3}\\
c=0\\
d=\frac{-1}{3}
\end{cases}$$
we finally have:
$$\frac{1}{3}\int \frac{dx}{x^2+x+2}-\frac{1}{3}\int \frac{dx}{x^2+4x+5}=$$
I use : $$a(x-p)^2+q$$
$p=\frac{-b}{2a}$ and $ q=\frac{-\bigtriangleup}{4a} $
Answer:
$$\frac{2\sqrt{7}}{21} arctg \frac {2x+1}{\sqrt{7}}-\frac{1}{3}arctg(x+2)+C$$
</s>