How to find the indefinite integral $$\int \frac{dx}{1+x^{n}}$$ where n is a positive integer?

  • 4
    $\begingroup$ It's a nasty hypergeometric function. $\endgroup$ – David H Apr 6 '14 at 14:41
  • 5
    $\begingroup$ I assume then that you are probably aware of the more beautiful expression for the definite integral $\displaystyle\int_0^\infty\frac{dx}{1+x^n}=\frac\pi n\csc\frac\pi n$ $\endgroup$ – Lucian Apr 6 '14 at 14:49
  • 1
    $\begingroup$ @Lucian. I was not aware of this one. It is really beautiful. Thanks for the info. Cheers. $\endgroup$ – Claude Leibovici Apr 6 '14 at 14:55
  • 1
    $\begingroup$ @Lucian. This one is nice too $$\displaystyle\int_1^\infty\frac{dx}{1+x^n}=\frac{H_{-\frac{1}{2 n}}-H_{-\frac{n+1}{2 n}}}{2 n}$$ $\endgroup$ – Claude Leibovici Apr 6 '14 at 15:02
  • 1
    $\begingroup$ This was asked a couple of weeks ago and I gave a fairly thorough survey of the literature on this: Solving this integral? $\endgroup$ – Dave L. Renfro May 16 '14 at 16:17

I just wanted to comment to give the general formula for this explicitly in case you have interest, but I can't comment so I must post an answer. For $n=2q-1,$ with $q\in\mathbb{N},$ and $m<n$ both natural numbers, $$\int\frac{x^{m-1}}{x^n+1}dx=\frac{\left(-1\right)^{m-1}}{n}\log\left(x+1\right)\\-\frac{1}{n}\sum\limits_{k=1}^{\frac{n-1}{2}}\cos\frac{(2k-1)m\pi}{n}\log\left(x^2-2x\cos\frac{(2k-1)\pi}{n}+1\right)\\+\frac {2}{n}\sum\limits_{k=1}^{\frac{n-1}{2}}\sin\frac{(2k-1)m\pi}{n}\tan^{-1}\frac{x-\cos\frac{(2k-1)\pi}{n}}{\sin\frac{(2k-1)\pi}{n}}.$$ If $n=2q,$ $$\int\frac{x^{m-1}}{x^n+1}dx=-\frac{1}{n}\sum\limits_{k=1}^{n/2}\cos\frac{(2k-1)m\pi}{n}\log\left(x^2-2x\cos\frac{(2k-1)\pi}{n}+1\right)\\+\frac {2}{n}\sum\limits_{k=1}^{n/2}\sin\frac{(2k-1)m\pi}{n}\tan^{-1}\frac{x-\cos\frac{(2k-1)\pi}{n}}{\sin\frac{(2k-1)\pi}{n}}.$$

Method of proof:

Partial fractions are obtained by $$\frac{x^{m-1}}{x^n+1}=\frac{1}{n}\sum\limits_{\alpha}\frac{\alpha^m}{x-\alpha},$$ where $\alpha^n+1=0.$ If $n$ is odd it is clear the first $\alpha$ is $-1.$ The rest of the terms must be from $$\frac{e^{\frac{(2k-1)m\pi}{n}i}}{x-e^{\frac{(2k-1)\pi}{n}i}}+\frac{e^{-\frac{(2k-1)m\pi}{n}i}}{x-e^{-\frac{(2k-1)\pi}{n}i}}=\frac{2\cos\frac{(2k-1)m\pi}{n}\left(x-\cos\frac{(2k-1)\pi}{n}\right)-2\sin\frac{(2k-1)m\pi}{n}\sin\frac{(2k-1)\pi}{n}}{x^2-2x\cos\frac{(2k-1)\pi}{n}+1}$$ and integrate from here; $$\int\frac{dx}{x^2+r^2}=\frac{1}{r}\tan^{-1}\frac{x}{r}.$$

  • $\begingroup$ Outline of a proof: you can evaluate this integral by considering the complex $n^{\rm th}$ roots of $-1$, doing partial fractions, and then recombining factors that are complex conjugate pairs. Then express the sums and products of the roots in terms of trigonometric functions of their angle. $\endgroup$ – heropup May 16 '14 at 4:00
  • $\begingroup$ I love to see the proof. $\endgroup$ – esege May 17 '14 at 7:52
  • $\begingroup$ I gave some details above, but I didn't have any more time to give more details. I wrote down the function you integrate, and if I have time I will write down how to solve the integral if you don't know, but I think you should start by writing $(x-\cos\beta)^2+\sin^2\beta$ in the denominator. $\endgroup$ – Hobbyist May 17 '14 at 14:09
  • $\begingroup$ I've actually found a closed form solution and posted the development on this page. -Mark $\endgroup$ – Mark Viola Feb 15 '17 at 20:05

We have $f(x)=\frac{1}{x^n+1}$. Note that we can write

$$f(x)=\prod_{k=1}^n(x-x_k)^{-1} \tag {1}$$

where $x_k=e^{i(2k-1)\pi/n}$, $k=1, \cdots,n$.

We can also express $(1)$ as

$$f(x)=\sum_{k=1}^na_k(x-x_k)^{-1} \tag {2}$$

where $a_k=\frac{-x_k}{n}$ (See the NOTE at the end of the development).

Now, we can write

$$\begin{align} \int\frac{1}{x^n+1}dx=-\frac1n\sum_{k=1}^nx_k\log(x-x_k)+C \end{align}$$

which can be more explicitly written as

$$\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'} $$

where $x_{kr}$ and $x_{ki}$ are the real and imaginary parts of $x_k$, respectively, and are given by

$$x_{kr}=\text{Re}\left(x_k\right)=\cos \left(\frac{(2k-1)\pi}{n}\right)$$

$$x_{ki}=\text{Im}\left(x_k\right)=\sin \left(\frac{(2k-1)\pi}{n}\right)$$


We will derive the form $a_k=-\frac{x_k}{n}$. To that end, we use $(2)$ and observe that

$$\begin{align} \lim_{x\to x_\ell}\left((x-x_{\ell})\sum_{k=1}^{n}a_k(x-x_k)^{-1}\right)&=\lim_{x\to x_\ell}\left((x-x_{\ell})\frac{1}{1+x^n}\right) \tag 3 \end{align}$$

The left-hand side of $(3)$ is simply $a_{\ell}$. For the right-hand side, straightforward application of L'Hospital's Rule yields

$$\begin{align} \lim_{x\to x_\ell}\left(\frac{(x-x_{\ell})}{1+x^n}\right)&=\frac{1}{nx_{\ell}^{n-1}} \end{align}$$

Finally, we note that since $x_{\ell}^n=-1$, then

$$\begin{align} \frac{1}{nx_{\ell}^{n-1}}&=\frac{x_{\ell}}{nx_{\ell}^n}\\\\ &=-\frac{x_{\ell}}{n} \end{align}$$

Thus, we have that

$$\bbox[5px,border:2px solid #C0A000]{a_{k}=-\frac{x_k}{n}}$$

  • $\begingroup$ Please let me know how I can improve my answer. I really want to give you the best answer I can. If the answer was not useful, I am happy to delete it. -Mark $\endgroup$ – Mark Viola Apr 4 '17 at 5:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.