How do I integrate $\frac{1}{x^6+1}$ My technique so far was substitution with the intent of getting to a sum of three fractions with squares in their denominators.
$t = x^2 \\
\frac{1}{x^6 + 1} = \frac{1}{t^3+1} = \frac{1}{(t+1)(t^2-t+1)}$
Then I try to reduce this fraction into a sum of two fractions
$\frac{A}{t+1} + \frac{B}{t^2-t+1} = \frac{(At^2-(A-B)t) + A + B}{(t+1)(t^2-t+1)}$
And this is where I reach a dead-end
$\begin{cases}
   At^2-(A-B)t &= 0 \\
   A + B &= 1
  \end{cases}$
Any techniques I'm overlooking?
 A: $$\begin{align}x^6+1=(x^2)^3+1^3&=(x^2+1)(x^4-x^2+1)=(x^2+1)((x^2+1)^2-3x^2)\\&=(x^2+1)(x^2-\sqrt3\,x+1)(x^2+\sqrt3\,x+1)\end{align}$$
Now you can use partial fractions:
$$\frac1{(x^2+1)(x^2-\sqrt3\,x+1)(x^2+\sqrt3\,x+1)}=\frac{Ax+B}{x^2+1}+\frac{Cx+D}{x^2-\sqrt3\,+1}+\frac{Ex+F}{x^2+\sqrt3\,+1}$$
A: You have to find the (complex) pairs of roots of the polynomial $x^6+1$, and then use the uncertain coefficients method as you did.
Notice that using the substitution $t=x^2$ leaves you with $x=\sqrt{t}$ and $dx=dt/\sqrt{t}$ which doesn't look quite nicely integrable.
When you have the polynomials $t^2+pt+q$ with complex roots, you can use a clever linear substitution to change that into $u^2+1$; then $\int du/(u^2+1) = \arctan u+C$.
--
As for finding the roots of $x^6+1=0$, we can either guess them or help ourselves. You already know that $x^2=t$ and $t^3+1=0$, which could be helpful. But we may even notice that $(x^6+1)(x^6-1)=x^{12}-1$, therefore $x$ are the 12th roots of unity which are not 6th roots of unity. These are
$$\xi, \xi^3, \xi^5, \xi^7=\overline{\xi^5}, \xi^9=\overline{\xi^3}\text{ and }\xi^{11}=\overline{\xi},$$
where $\xi=e^{2\pi i/12}=e^{i\pi/6}$ is the fundamental (or first) 12th root of unity.
A: Observe that $$x^6 + 1 = (x^2)^3 + 1 = (x^2 + 1)(x^4 - x^2 + 1).$$  To factor the quartic term, suppose there is a factorization of the form $$\begin{align*} x^4 - x^2 + 1 &= (x^2 + ax + 1)(x^2 + bx + 1) \\ &= x^4 + (a+b)x^3 + (ab+2)x^2 + (a+b)x + 1. \end{align*}$$  We thus require $a + b = 0$, and $ab + 2 = -1$, from which we may take without loss of generality that $a = \sqrt{3}$, $b = -\sqrt{3}$.  Thus the desired factorization is $$x^6 + 1 = (x^2 + 1)(x^2 + \sqrt{3}x + 1)(x^2 - \sqrt{3}x + 1).$$  Now we suppose there exist variables $A, B, C, D, E, F$ such that $$\frac{1}{x^6+1} = \frac{Ax + B}{x^2 + 1} + \frac{Cx + D}{x^2 + \sqrt{3}x + 1} + \frac{Ex + F}{x^2 - \sqrt{3}x + 1}.$$  Multiplying both sides by $x^6 + 1$ and equating coefficients on the RHS to the LHS (all are zero except the constant coefficient) gives a system of equations in the unknown variables, the solution of which is $$(A,B,C,D,E,F) = \left(0, \tfrac{1}{3}, \tfrac{1}{2\sqrt{3}}, \tfrac{1}{3}, -\tfrac{1}{2\sqrt{3}}, \tfrac{1}{3}\right).$$  This gives us three integrands of the form $$\frac{P(x)}{Q(x)}$$ where $P$ is at most linear, and $Q$ is quadratic, which are easily (but tediously) handled.  For instance, $$\int \frac{\sqrt{3}x + 2}{6(x^2+\sqrt{3}x+1)} \, dx = \frac{\sqrt{3}}{12} \int \frac{2x + \sqrt{3}}{x^2 + \sqrt{3}x + 1} \, dx - \frac{1}{12} \int \frac{dx}{x^2 + \sqrt{3}x + 1},$$ and the first integral is simply a logarithm, and the second is an arctangent after completing the square in the denominator:  $x^2 + \sqrt{3}x + 1 = (x + \tfrac{\sqrt{3}}{2})^2 + (\tfrac{1}{2})^2$.
