Evaluation of $$\int\frac{x^7+2}{\left(x^2+x+1\right)^2}dx$$
$\bf{My\; Try::}$ Let $$\displaystyle \mathop{I = \int\frac{x^7+2}{(x^2+x+1)^2}}dx = \int\frac{(x^7-1)+3}{(x^2+x+1)^2}dx$$
$$\mathop{\displaystyle = \int\frac{x^7-1}{(x^2+x+1)^2}}+\displaystyle \int\frac{3}{(x^2+x+1)^2}dx$$
Now Using the formula $$\bullet x^7-1 = (x-1)\cdot \left[x^6+x^5+x^4+x^3+x^2+x+1\right]$$
So $$\bullet \; (x^7-1) = (x-1)\left[(x^4+x)\cdot (x^2+x+1)+1\right]$$
So we get $$\displaystyle I = \int\frac{(x-1)\cdot (x^4+x)\cdot (x^2+x+1)}{(x^2+x+1)^2}dx+\frac{1}{2}\int\frac{2x-2}{(x^2+x+1)^2}+3\int\frac{1}{(x^2+x+1)^2}dx$$
$$\displaystyle I = \underbrace{\int\frac{(x-1)(x^4+x)}{x^2+x+1}dx}_{J}+\underbrace{\frac{1}{2}\int\frac{(2x+1)}{(x^2+x+1)^2}dx}_{K}+\underbrace{\frac{3}{2}\int\frac{1}{(x^2+x+1)^2}dx}_{L}$$
Now $$\displaystyle J = \int\frac{(x-1)(x^4-x)+2x(x-1)}{(x^2+x+1)}dx = \int(x^3-2x^2+x)dx+\int\frac{2x^2-2x}{x^2+x+1}dx$$
Now we can solve the integral Using the formulae.
My question is can we solve it any other way, If yes then plz explain here
Thanks
HINT: prove that $$\frac{x^7+2}{(x^2+x+1)^2}={x}^{3}-2\,{x}^{2}+x+2+{\frac {-4\,x-2}{{x}^{2}+x+1}}+{\frac {x+2}{ \left( {x}^{2}+x+1 \right) ^{2}}} $$