This trouble arose when I earlier played with W|A, I found that it can compute $\int \frac{dx}{x^{11}-1}$, which has a huge messy answer. With great uncertainty, this's my work so far:
Let $\displaystyle I=\int \frac 1 {x^n-1} dx$.
Let $\alpha=e^{\frac {2i\pi} n}$ be $n$th root of unity, then $\displaystyle x^n-1=\prod_{k=1}^n (x-\alpha^k)$
$$\displaystyle\prod_{k=1}^{n-1} (x-\alpha^k)=\sum_{k=1}^{n-1} x^k...(*)$$
Write $\displaystyle \frac 1 {x^n-1}=\sum_{k=1}^n \frac {A_k}{x-\alpha^k}$.
Multiply by $x^n-1$ on both sides, $\displaystyle 1=\sum_{k=1}^n \prod_{1\leq l\leq n,l\neq k}A_k(x-\alpha^l)$
Substitute $x=\alpha^k$, then $\displaystyle \prod_{1\leq l\leq n,l\neq k}A_k(\alpha^k-\alpha^l)=1$
$$\displaystyle \prod_{1\leq l\leq n,l\neq k}A_k \alpha^l(\alpha^{k-l}-1)=1$$
$$\displaystyle A_k\alpha^{\frac{n(n-1)} 2-k}\prod_{l=1}^{n-1}(\alpha^l-1)=1$$
$$\displaystyle A_k\alpha^{\frac{n(n-1)} 2-k}(-1)^{n-1}n=1[(*),x=1]$$
$$\displaystyle A_k=\frac{\alpha^k}n$$
Therefore, $\displaystyle I=\int \sum_{k=1}^n \frac 1 n\frac {\alpha^k}{x-\alpha^k}=\frac 1 n \sum_{k=1}^n \alpha^k \log(x-\alpha^k)$.
I know that, in the last line, the logarithm of a complex number is a set of value, but since $I$ is real, all the imaginary branches should cancel out each other, right? Is there any conceptual or other kind of error in above? And could the answer be further simplified?
Thanks.
Since the complex roots of a polynomial with real coefficients exist in conjugate pairs, and in particular, the roots of unity $\zeta_n^k$, $k = 0, 1, 2, \ldots, n-1$ satisfy the relationship $$\zeta_n^k = \zeta_n^{-k} = \bar \zeta_n^k,$$ (here I use $\zeta$ instead of $\alpha$) it follows that the partial fraction decomposition takes on the form $$\frac{1}{n}\left( \frac{1}{z-1} + \sum_{k=1}^{\lfloor n/2 \rfloor} \frac{(\zeta^k + \zeta^{-k})z - 2}{z^2 - (\zeta^k + \zeta^{-k})z + 1} \right),$$ where $\zeta^k + \zeta^{-k} = 2 \cos \frac{2\pi k}{n} \in \mathbb R.$ The antiderivative of the summand above can be expressed in terms of a logarithm and and inverse tangent function using the usual methods, but I won't do it here because it's rather tedious.