How to find the indefinite integral $$\int \frac{dx}{1+x^{n}}$$ where n is a positive integer?
-
4It's a nasty hypergeometric function. – David H Apr 06 '14 at 14:41
-
5I 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$ – Lucian Apr 06 '14 at 14:49
-
1@Lucian. I was not aware of this one. It is really beautiful. Thanks for the info. Cheers. – Claude Leibovici Apr 06 '14 at 14:55
-
1@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}$$ – Claude Leibovici Apr 06 '14 at 15:02
-
1This was asked a couple of weeks ago and I gave a fairly thorough survey of the literature on this: Solving this integral? – Dave L. Renfro May 16 '14 at 16:17
2 Answers
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}.$$

- 1,483
-
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. – heropup May 16 '14 at 04:00
-
-
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. – Hobbyist May 17 '14 at 14:09
-
I've actually found a closed form solution and posted the development on this page. -Mark – 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)$$
NOTE:
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}}$$

- 179,405
-
Do you mind in explaning how to get the second term in the main formula, $x_{ki}\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)$ ? I got $$\log(x-x_k)=\log(x-x_{kr}-x_{ki})$$
$$\Im\left{\log(x-x_k)\right}=\arctan\left(\frac{x_{ki}}{x-x_{kr}}\right)$$. Also, if You don´t mind, how the coefficient becomes $x_{ki}$? Thank you!
– Ricardo770 Aug 05 '21 at 21:16 -
@Ricardo770 Begin with $x_k\log(x-x_k)=(x_{kr}+ix_{ki})\log((x-x_{kr}-ix_{x_{ki}}))$. Then, using $|x_k|^2=1$, write $|x-x_{kr}-ix_{ki}|^2=x^2-2x_{kr}x+1$ and $\arg(x-x_k)=\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)$. Can you proceed? – Mark Viola Aug 05 '21 at 21:25
-
thank you for your reply! What I don´t get is the $$arg(x-x_k)=\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)$$. I am thinking in $$arg(a+ib)=arctan\left(\frac{b}{a}\right)$$., and it seems to be $arctan\left(\frac{a}{b}\right)$ here. Sorry if I am missing something obvious. Thank you again. – Ricardo770 Aug 05 '21 at 21:49
-
1Note that $\arctan(x)+\arctan(1/x)=(\pi/2) \text{sgn}(x)$ and this is an indefinite integral (i.e., the integration constant can be any number). – Mark Viola Aug 05 '21 at 21:53