<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: the second integral is given by $$\int\frac{x+1}{x^2+x+1}dx$$ you must write the denominator as $$(x+1/2)^2+3/4)$$
</s>