<s>[INST] 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 $$
 [/INST] 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}$$
</s>