Integral of $\frac{1}{x^{n}+1}$ for odd $n$ I am trying to find a general formula for
  $$ \int \frac{1}{x^{n}+1} \, dx $$
where $n$ is an odd integer.
I can't find any answers on this site for this question, and I have already tried the following.
We can write
  $$ x^{n} + 1 =  (x+1)\sum_{k=0}^{n-1} (-1)^{k}x^{k} $$
and so we get
  $$ \int \frac{1}{x^{n}+1} \, dx  = \int \frac{1}{x+1} + \frac{\sum_{k=0}^{n-2} a_{k}x^{k}}{\sum_{k=0}^{n-1} (-1)^{k}x^{k}} \, dx$$
for some numbers $a_{k}$.
When $n=3$, this is easy enough to solve using partial fractions. When $n=5$ it is tricky but doable. For $n \geq 7$ it becomes intractable and even Mathematica fails to evaluate.
Is there a way to continue with my approach? Is there a better way to find a general formula?
 A: It's doable but the details are pretty ugly so sorry for not completing this calculation. But I will give a complete algorithm for it.
The idea is to write $\frac{1}{x^n+1} = \sum_{i=1}^{n}\frac{1}{f'(\psi_i)(x-\psi_i)}$, where $\psi_i$ are the n-th roots of unity. Now you can further write the sum by grouping $\frac{1}{f'(\psi_i)(x-\psi_i)} + \frac{1}{f'(\psi_{n-i})(x-\psi_{n-i})} = \frac{(2cos\frac{2\pi}{n})x-2}{x^2-(2cos\frac{2\pi}{n})x+1}$ so we have actually managed to split our poly into fractions of irreducible polys over R(of degree 1 and 2!), which we know how to integrate.
A: $\frac 1 {x^{n}+1}=1-x^{n}+(-x^{n})^{2}+\cdots$ and you can  integrate this term by term for $|x| <1$. Note that for $n$ odd the integrand has a singularity at $-1$. 
A: We know that $$x^n+1=\prod _{k=1}^{n} x-e^{i{2k+1\over n}\pi}$$since all the roots are of order $1$, we can write $${1\over x^n+1}={1\over\prod _{k=1}^{n} (x-e^{i{2k+1\over n}\pi})}={1\over n}\sum_{k=1}^{n} {e^{-i\pi {n-1\over n}(2k+1)}\over x-e^{i{2k+1\over n}\pi}}$$by integrating we obtain$$\int{1\over x^n+1}dx={1\over n}\sum_{k=1}^{n} {e^{-i\pi {n-1\over n}(2k+1)} \ln | x-e^{i{2k+1\over n}\pi}|}+C$$
A: Let's find the Taylor series for $x^a$. Assume that $D_b^kf(x)=\frac{\mathrm{d}^k}{\mathrm{d}x^k}f(x)\big|_{x=b}$.
$$D^0x^a=x^a$$
$$D^1x^a=ax^{a-1}$$
$$D^2x^a=a(a-1)x^{a-2}$$
$$\cdots$$
$$D^kx^a=x^{a-k}\prod_{i=0}^{k-1}(a-i)$$
We'll center our Taylor series about the point $x=1$. Thus, we know that our Taylor-Series coefficients are given by
$$c_k=\frac1{k!}\prod_{i=0}^{k-1}(a-i)$$
And hence
$$x^a=\sum_{k\geq0}\frac{(x-1)^k}{k!}\prod_{i=0}^{k-1}(a-i)$$
This series has a radius of convergence of $1$, which is something to keep in mind.
We proceed by noting that
$$(1-x)^a=\sum_{k\geq0}(-1)^k\frac{x^k}{k!}\prod_{i=0}^{k-1}(a-i)$$
And plugging in $a=-1$ gives
$$\frac1{1-x}=\sum_{k\geq0}(-1)^k\frac{x^k}{k!}\prod_{i=0}^{k-1}(-1-i)$$
$$\frac1{1-x}=\sum_{k\geq0}(-1)^k(-1)^k\frac{x^k}{k!}\prod_{i=0}^{k-1}(i+1)$$
$$\frac1{1-x}=\sum_{k\geq0}x^k$$
$$\frac1{1+x}=\sum_{k\geq0}(-1)^kx^k$$
$$\frac1{1+x^n}=\sum_{k\geq0}(-1)^kx^{nk}$$
So if we assume that $|x|<1$, we have that
$$
\begin{align}
\int\frac{\mathrm{d}x}{1+x^n}=&\int\sum_{k\geq0}(-1)^kx^{nk}\mathrm{d}x\\
=&\sum_{k\geq0}(-1)^k\int x^{nk}\mathrm{d}x\\
=&\sum_{k\geq0}(-1)^k\frac{x^{nk+1}}{nk+1}\\
\end{align}
$$
And there you go.
