Question is in the title, where $\Phi_n$ denotes the $n$-th cyclotomic polynomial.
Motivation: I'm just teaching my calculus students basic integration of rational functions with $\log$ and $\arctan$, so I wondered about this.
Observation and more precise question: Pairing complex conjugates, over $\mathbb R$ these polynomials split into factors of the forms $x-1$, $x+1$, and $$f_{k,n}(x) = x^2-2\cos(2k\pi/n)x +1,$$ where the reciprocal of the last one, if I'm not mistaken, has antiderivative $$\frac{1}{\sin(2k\pi/n)}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right).$$ Now using partial fractions and then integrating, one gets summands of the following types:
- A) $\log|x-1|$
- B) $\log|x+1|$
- C) $\frac{1}{\sin(2k\pi/n)}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right)$
- D) $\log (f_{k,n}(x))$.
(The last two, which come from taking apart something of the form $$\frac{\text{linear}}{f_{k,n}(x)},$$ are of course the only ones in $\int \frac{dx}{\Phi_n(x)}$ for $n\ge 3$.)
These bits I recognise in the example formulae below and I'm happy to have these as "building blocks" in a general formula. So I guess all I'm really asking for is a formula which gives the coefficients of each of the terms A)-D) in the integrals. In other words, we have
$$\int \frac{dx}{x^n-1} = \color{red}{A_n} \cdot \log|x-1| + \color{red}{B_n} \cdot \log|x+1| + \sum_{1\le k <\frac{n}{2}} \frac{\color{red}{C_{n,k}}}{\sin(2k\pi/n)}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right) + \sum_{1\le k <\frac{n}{2}} \color{red}{D_{n,k}} \log(f_{n,k})$$
and for $n \ge 3$,
$$ \int \frac{dx}{\Phi_n(x)} = \sum_{1\le k <\frac{n}{2}\\gcd(k,n)=1} \frac{\color{red}{E_{n,k}}}{\sin(2k\pi/n)}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right) + \sum_{1\le k <\frac{n}{2}\\gcd(k,n)=1} \color{red}{F_{n,k}} \log(f_{n,k})$$
and I'm looking for closed formulae depending on $n$ and $k$ for the coefficients in red.
Idea: I assume if one goes to $\mathbb C$ one just gets terms of the form $$ \log (x-\zeta)$$ where $\zeta$ runs through the respective roots of unity, and choosing the right branches of $\log$ and grouping complex conjugates together might give a formula for the coefficients. But going through this is beyond me at this point.
Edit:
From Eric Wofsey's answer one gets, by pairing complex conjugates and using the well-known relation (1, 2, 3) between arctan and complex logarithm (leaving out domain restriction and integration constants):
$$\int \frac{dx}{x^n-1} = \color{red}{\frac{1}{n}} \cdot \log|x-1| + \color{blue}{(}(\color{red}{-\frac{1}{n}}) \cdot \log|x+1|\color{blue}{)} + \sum_{1\le k <\frac{n}{2}} \color{red}{\frac{-2\sin(2k\pi/n)}{n}}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right) + \sum_{1\le k <\frac{n}{2}} \color{red}{\frac{\cos(2k\pi/n)}{n}} \log(f_{n,k})$$
(where the term in $\color{blue}{\text{blue}}$ brackets appears iff $n$ is even), i.e my original normalisation of the arctan-term was bad, would give $C_{n,k} = -2\sin^2(2k\pi/n)/n$),;
and for $n \ge 3$,
$$\int \frac{dx}{\Phi_n(x)} = \sum_{1\le k <\frac{n}{2}\\gcd(k,n)=1} \color{red}{-2\cdot\mathfrak{Im}\left(\frac{1}{\Phi'_n(\zeta_k)}\right)}\arctan\left(\frac{x-\cos(2k\pi/n)}{\sin(2k\pi/n)}\right) + \sum_{1\le k <\frac{n}{2}\\gcd(k,n)=1} \color{red}{\mathfrak{Re}\left(\frac{1}{\Phi'_n(\zeta_k)}\right)} \log(f_{n,k})$$
(where $\zeta_{k,n} = \exp(2k\pi i/n)$).
Remains only the question if there is a nice general formula for the real/imaginary part of $\displaystyle \frac{1}{\Phi'_n(\zeta_k)}$. I have asked that as a new question here.