Evaluate $\int\frac1{1+x^n}dx$ for $n\in\mathbb R$
Solution 1:
In THIS ANSWER, I showed that that the indefinite integral of interest is given by
$$\bbox[5px,border:2px solid #C0A000]{\int\frac{1}{x^n+1}dx=-\frac1n\sum_{k=1}^n\left(\frac12 x_{kr}\log(x^2-2x_{kr}x+1)-x_{ki}\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)\right)+C} $$
for $n\ge 1$, where $x_{kr}$ and $x_{ki}$ can be written, respectively, as
$$x_{kr}=\cos \left(\frac{(2k-1)\pi}{n}\right)$$
$$x_{ki}=\sin \left(\frac{(2k-1)\pi}{n}\right)$$
For $n<0$, we simply write
$$\int \frac{1}{1+x^{-|n|}}\,dx=x-\int \frac{1}{1+x^{|n|}}\,dx$$
and use the aforementioned result with $n$ replaced with $|n|$.
Solution 2:
For positive integers $n$ you can write $$ \dfrac{1}{1+x^n} = \sum_{\omega} \dfrac{r(\omega)}{x - \omega}$$ where the sum is over the $n$'th roots of $-1$ and $r(\omega)$ is the residue of $1/(1+x^n)$ at $x = \omega$, so that your integral is $$ c + \sum_\omega r(\omega) \log(x - \omega)$$
You can also express the power series solution in terms of the Lerch Phi function: $$ c + \dfrac{x}{n} {\rm LerchPhi}(-x^n,1,1/n) $$
Solution 3:
Slightly different approach to Robert Israel's. Using $$\frac{1}{1+x}=1-x+x^2-x^3+x^4-\cdots,\tag{1}$$ where $|x|<1$ you can substitute $x^n$ for $x$ to obtain $$\int\frac{1}{1+x^n}dx=\int 1-x^n+x^{2n}-x^{3n}+x^{4n}-\cdots dx$$
So we end up with
$$\int\sum_{k=0}^\infty (-1)^kx^{kn}dx=\sum_{k=0}^\infty(-1)^k\frac{x^{kn+1}}{kn+1}+c=\frac{x}{n} \Phi \left(-x^n,1,\frac{1}{n}\right)+c.$$ This actually works for $x,n\in\mathbb{R}$, but you'd have to prove that for $x$ since it does not follow from (1).