I'm trying to resolve this exercice: Determine the primitive $F$ of the function: $f(x)=\frac{|x|+x+4}{(x^2+x+1)(x+2)}$, such that $F(1)=-1$, moreover specifies the widest range in which the primitive exists.
I tried to poceed in this way.
If $x\geq0$, we solve the integral $\int \frac{2}{x^2+x+1} dx = \frac{4\sqrt{3}}{3}atan(\frac{2}{\sqrt{3}}(x+\frac{1}{2}))+c_1$.
If $x<0$, we solve the integral $\int \frac{4}{(x^2+x+1)(x+2)} dx = -\frac{2}{3}log(x^2+x+1)+\frac{4\sqrt{3}}{3}atan(\frac{2}{\sqrt{3}}(x+\frac{1}{2}))+\frac{4}{3}log|x+2|+c_2 $.
To ensure the continuity in $0$,we compute that $c_2=c_1-\frac{4}{3}log(2)$. It is sufficent to impose that $F(1)=-1$ and we have $\bar{c_1}=-1-\frac{4\pi\sqrt{3}}{9}$, so the primitive is:
$F(x)=\begin{cases} \frac{4\sqrt{3}}{3}atan(\frac{2}{\sqrt{3}}(x+\frac{1}{2}))+\bar{c_1}\quad \text{if} \;\;x\geq 0 \\ -\frac{2}{3}log(x^2+x+1)+\frac{4\sqrt{3}}{3}atan(\frac{2}{\sqrt{3}}(x+\frac{1}{2}))+\frac{4}{3}log|x+2|+\bar{c_1}-\frac{4}{3}log(2) \quad \text{if} \;\;x<0\end{cases}$
The widest range in which the primitive exists, seems to be $\mathbb{R} \backslash \{-2\}$. Is this reasoning correct? Is there another approach which use the foundamental theorem of integral calculus?
Thank you.