<s>[INST] How can I solve $\int \frac{3x+2}{x^2+x+1}dx$ I want to compute this primitive $$I=\int \frac{3x+2}{x^2+x+1}dx.$$
I split this integral into two part:
$$\int \frac{3x+2}{x^2+x+1}dx=\int \frac{2x+1}{x^2+x+1}dx+\int \frac{x+1}{x^2+x+1}dx,$$
For the first part:
$$\int \frac{2x+1}{x^2+x+1}dx= \ln(|x^2+x+1|)+c_1$$
For the second part: due a change of variable $u=x+1$, I find
$$\int \frac{x+1}{x^2+x+1}dx= \int \frac{x+1}{x(x+1)+1}dx=\int \frac{u}{u(u-1)+1}dx=\dots$$
 [/INST] Hint For the second:
$$\int \frac{x+1}{x^2+x+1}dx$$
Rewrite as $$\int\bigg( \frac{2x+1}{2(x^2+x+1)}+\frac{1}{2(x^2+x+1)} \bigg)dx$$
$$=\underbrace{\frac 1 2 \int\frac{2x+1}{x^2+x+1}dx}_{:=I}+\underbrace{\frac 1 2 \int \frac{1}{x^2+x+1}dx}_{:=J}$$
For $I$ substitute $t=x^2+x+1$ and $dt=(2x+1)dx$ 
For $J$ complete the square : $\frac 1 2\displaystyle\int \frac{1}{(x+1/2)^2+3/4}$ and now substitute $\varphi=x+1/2$ and $d\varphi=dx\Longrightarrow \frac 1 2\displaystyle\int \frac{1}{\varphi ^2 +3/4}d \varphi$
factor out $3/4$ from the denominator $\frac 2 3\displaystyle\int \frac{1}{(4\varphi ^2)/(3)+1}d \varphi$ and then substitute $z=\frac{2 \varphi}{\sqrt 3}$ and $dz=\frac{2}{\sqrt 3}d \varphi$ so you will get $\frac {1}{\sqrt 3}\displaystyle\int \frac{1}{z^2+1}dz$ and from here it is easy 
</s>