Problem related to integration I tried using partial fractions but I am not sure whether it is the right approach or not. I need help with this problem
Evaluation of Integral $$\int\frac{3x^4-1}{(x^4+x+1)^2}dx $$
 A: Let $$\displaystyle I = \int\frac{3x^4-1}{(x^4+x+1)^2}dx = \int\frac{3x^4-1}{x^2\left(x^3+1+x^{-1}\right)^2}dx = \int\frac{3x^2-x^{-2}}{(x^3+1+x^{-1})^2}dx$$
Now Put $x^3+1+x^{-1} = t\;,$ Then $(3x^2-x^{-2})dx = dt$
So Integral $$\displaystyle I = \int\frac{1}{t^2} dt = -\frac{1}{t}+\mathcal{C} = -\frac{1}{x^3+1+x^{-1}}+\mathcal{C}$$
So we get $$\displaystyle I = \int\frac{3x^4-1}{(x^4+x+1)^2}dx = -\left[\frac{x}{x^4+x+1}\right]+\mathcal{C}$$
A: Hint
Since you need to compute $$\int \frac{3 x^4-1}{\left(x^4+x+1\right)^2}dx$$ and you already have a perfect square in the denominator think about the derivative of $$A=\frac {P(x)}{\left(x^4+x+1\right)}$$ $$A'=\frac{\left(x^4+x+1\right) P'(x)-\left(4 x^3+1\right) P(x)}{\left(x^4+x+1\right)^2}=\frac{3 x^4-1}{\left(x^4+x+1\right)^2}$$ $P(x)$ should be a very low order polynomial. Just find it.
A: Let $$\displaystyle I = \int\frac{3x^4-1}{(x^4+x+1)^2}dx = \int\frac{3x^4+4x^3-4x^3-1}{(x^4+x+1)^2}dx $$
So $$I= \underbrace{\int\frac{3x^4+4x^3}{(x^4+x+1)^2}dx}_{J}-\int\frac{4x^3+1}{(x^4+x+1)^2}dx$$
for second Integral Put $x^4+x+1 = t\;,$ Then $(4x^3+1)dx = dt$
Now for calculation of $\displaystyle J = \int\frac{3x^4+4x^3}{(x^4+x+1)^2}dx$
For these type of integral, we will take highest power of $x$ from denominator, 
and then adjust it into Numerator
So we get $$\displaystyle J = \int\frac{3x^4+4x^3}{x^8(1+x^{-3}+x^{-4})}dx = \int\frac{3x^{-4}+4x^{-5}}{(1+x^{-3}+x^{-4})^2}dx$$
Now put $(1+x^{-3}+x^{-4}) = u\;,$ Then $(3x^{-4}+4x^{-3})dx = -du$
So we get $$\displaystyle I = -\int\frac{1}{u^2}du-\int\frac{1}{t^2}dt = \frac{1}{u}+\frac{1}{t}+\mathcal{C} = \frac{1}{1+x^{-3}+x^{-4}}+\frac{1}{x^4+x+1}+\mathcal{C}$$
So we get $$I = \int\frac{3x^4-1}{(x^4+x+1)^2}dx = \frac{x^4+1}{x^4+x+1}+\mathcal{C} = -\left[\frac{x}{x^4+x+1}\right]+\mathcal{C'}$$
Bcz $$\frac{x^4+1}{x^4+x+1} = \frac{(x^4+x+1)-1}{x^4+x+1} = 1-\frac{x}{x^4+x+1}$$
