Find the integral $$I=\int\dfrac{x^5-x^2-1}{x^5+x^4+x^3+x^2+x+1}dx$$
Let $\dfrac{x^5-x^2-1}{x^5+x^4+x^3+x^2+x+1}=f(x).$ We can write $f(x)$ as follows $$f(x)=1+\dfrac{-x^4-x^3-2x^2-x-2}{x^5+x^4+x^3+x^2+x+1},$$ so the integral is actually $$I=\int dx+\int\dfrac{-x^4-x^3-2x^2-x-2}{x^5+x^4+x^3+x^2+x+1} dx=x+I_1$$
Now let $\dfrac{-x^4-x^3-2x^2-x-2}{x^5+x^4+x^3+x^2+x+1}=g(x)$. Then I tried to write $g(x)$ as $$g(x)=\dfrac{A}{x+1}+\dfrac{Bx+C}{x^2+x+1}+\dfrac{Dx+E}{x^2-x+1}\iff \\-x^4-x^3-2x^2-x-2=A(x^2+x+1)(x^2-x+1)+(Bx+C)(x+1)(x^2-x+1)+\\+(Dx+E)(x+1)(x^2+x+1)$$ Let us put $x=-1$ to get $$-1+1-2+1-2=A\cdot 3\Rightarrow A=-1$$
I don't see how to find the other unknowns $B,C,D,E$. My try:
Let $x_0$ be such that $x_0^2-x_0+1=0$. Then we want $$(*) -x_0^4-x_0^3-2x_0^2-x_0-2=(Dx_0+E)(x_0+1)(x_0^2+x_0+1)$$ Note that $$(x_0^2-x_0+1)^2=0=x_0^4-2x_0^3+3x_0^2+2x_0+1\Rightarrow -x_0^4+2x_0^3-3x_0^2+2x_0-1=0$$ Well then we can write the LHS of (*) as $$-x_0^4+2x_0^3-3x_0^2+2x_0-1-3x_0^3+x_0^2-3x_0-1\\=-3x_0^3+x_0^2-3x_0-1=-3x_0^3+x_0^2-x_0+1-2x_0-2=-3x_0^3-2x_0-2.$$ The RHS of (*) is $$(Dx_0+E)(x_0+1)(x_0^2-x_0+1+2x_0)\\=2x_0(x_0+1)(Dx_0+E)=2Dx_0^3+2(E+D)x_0^2+2Ex_0,$$ which cannot be true as there's no constant term here (for the LHS I got $-2$). I don't see where my mistake is. I tried to put $s:s^2+s+1=0$ and I reached something similar (that they cannot be equal). Any help would be appreciated.