Calculating $\int\frac{a^4-x^4}{x^4+a^2x^2+a^4}dx$ 
$$\int\frac{a^4-x^4}{x^4+a^2x^2+a^4}dx$$

I tried factoring as $${(a^2-x^2)(a^2+x^2)}$$ $$\text{and}$$ $$(x^2+a^2+ax)(x^2+a^2-ax)$$ but didn't get much after this. I sew that the expression is symmetric in a,x but I don't know how to use that.
 A: Rewrite the integrand as
$$\frac{a^4 - x^4}{x^4 + a^2x^2 + a^4}
=-1+ \frac{\frac {3a}2(\frac 1a +\frac{a}{x^2})-\frac a2(\frac 1a -\frac{a}{x^2})}{\frac{x^2 }{a^2}+ \frac{a^2}{x^2}+1}
$$
and then integrate as follows
$$\int\frac{a^4-x^4}{x^4+a^2x^2+a^4}dx
= -x + \frac{3a}2\int \frac{d(\frac xa-\frac ax)}{(\frac xa-\frac ax)^2+3} -\frac{a}2\int \frac{d(\frac xa+\frac ax)}{(\frac xa+\frac ax)^2-1}\\
=-x +\frac{\sqrt3 a}2\tan^{-1}\frac{\frac xa-\frac ax}{\sqrt3}
+\frac a2\coth^{-1}(\frac xa+\frac ax)+C
$$
A: Hint:
First,
$$\dfrac{a^4 - x^4}{x^4 + a^2x^2 + a^4} = \dfrac{a^2x^2 + 2a^4}{x^4 + a^2x^2 + a^4} - 1 = a^2\dfrac{x^2 + 2a^2}{x^4 + a^2x^2 + a^4} - 1$$
Second,
$$\dfrac{x^2 + 2a^2}{x^4 + a^2x^2 + a^4} = \dfrac{x^2 + 2a^2}{\left(x^2 -ax + a^2\right)\left(x^2 + ax + a^2\right)}$$
Now, perform partial-fraction decomposition.
A: $$I=\int\frac{a^4-x^4}{x^4+a^2x^2+a^4}\,dx=a\int\frac{1-y^4}{y^4+y^2+1}\,dy=a\int\frac{1-y^4}{\left(y^2-y+1\right) \left(y^2+y+1\right) }\,dy$$
$$I=\frac a2\int\Bigg[\frac{\left(y+\frac 12\right)+\frac 32}{y^2+y+1}-\frac{\left(y-\frac 12\right)-\frac 32}{y^2-y+1}-1 \Bigg]\,dy$$ So, beside the linear term (and the integration constant), you should end with a logarithm and an arctangent.
