<s>[INST] How can I evaluate this indefinite integral? $\int\frac{dx}{1+x^8}$ How do I find $\displaystyle\int\dfrac{dx}{1+x^8}$?
My friend asked me to find $\displaystyle\int\dfrac{dx}{1+x^{2n}}$ for a positive integer $n$. But looking up I am getting pretty noisy answer for a general value.
I have seen that $\displaystyle\int\dfrac{dx}{1+x^6}$ can be broken into partial fractions because of the odd factor of $6$. So I am curious what is the algorithm to compute the integral for $n$ being a power of $2$. 
 [/INST] $$x^8+1=x^8+2x^4+1-2x^4=(x^4+1)^2-2x^4=(x^4+\sqrt{2}x^2+1)(x^4-\sqrt{2}x^2+1)$$
$$x^4 \pm \sqrt{2}x^2+1= x^4+2x^2+1 -(2 \pm \sqrt{2})x^2=(x^2+1 -\sqrt{2 \pm \sqrt{2}}x)(x^2+1 +\sqrt{2 \pm \sqrt{2}}x)$$
Therefore
$$x^8+1=(x^2+1 -\sqrt{2 + \sqrt{2}}x)(x^2+1 +\sqrt{2 + \sqrt{2}}x)(x^2+1 -\sqrt{2 - \sqrt{2}}x)(x^2+1 +\sqrt{2 - \sqrt{2}}x)$$
Now the partial fraction decomposition is ugly but doable.
</s>