17

I am a student who is preparing for IIT exam. I was just practicing calculus and encountered this problem. I tried different substitutions but none of them seemed to work. What is the value of the indefinite integral $$\int \frac{1}{x^{2n} +1} \, \mathrm{d}x \,?$$

Travis Willse
  • 108,056
  • 1
    There's no simple form which is valid for all $n \in \mathbb{N}$ (you need to use hypergeometric functions). That's why your substitutions lead to nowhere. – Glorfindel Jul 08 '15 at 16:58
  • Hmm... it seems the result involves hypergeometric functions... are you sure this is the correct problem? – Cristopher Jul 08 '15 at 16:59
  • 2
    You can solve that by decomposition in simple fractions, as the roots are easy to find. But the computation is tedious. –  Jul 08 '15 at 17:00
  • 1
    Yah, it is. My teacher told that this is one of the hardest Integration sum for our level. Well I have never heard of hypergeometric functions before. – Dhiraj Barnwal Jul 08 '15 at 17:00
  • Either hypergeometric functions or complex numbers would be nice, but maybe they are not needed. – mathreadler Jul 08 '15 at 17:01
  • I do know about complex numbers and its properties. Can it be used to avoid hypergeometric function? – Dhiraj Barnwal Jul 08 '15 at 17:02
  • You might as well represent it as simple infinite series. – Noam Shalev Jul 08 '15 at 17:06
  • 1
    Yes, you can use the "roots of unity". x^n=k have a set of solutions which are spread on a circle in the complex plane for n even you can probably pair them together to get real coefficients. – mathreadler Jul 08 '15 at 17:06
  • @nospoon: Without any information about the integration interval, it can be very tricky to interchange an integral and a series. In this case, better not. – Alex M. Jul 08 '15 at 17:21
  • 2
    Note that a rather clean partial fraction exists$$ \int \frac{dx}{1+x^{2n}}=\frac{1}{n}\sum_{k=1}^{n}\int\frac{1-x\cos a_k}{x^2-2x\cos a_k+1}dx, >>>>>a_k=\frac{(2k-1)\pi}{2n} $$ – Quanto Aug 30 '24 at 14:51

3 Answers3

43

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}$.

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 1:

The integral of $\frac{1}{1+x^{2n}}$ is a special case for the development herein. Simply let $n\to 2n$.


NOTE 2:

As requested, 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}}$$

Mark Viola
  • 184,670
  • 3
    After the factorization given by Dr. MV we see that $|x_k|<1$ so that we may use geometric series such as $$ \int {\frac{{dx}}{{x^{2n} + 1}}} = \int {\sum\limits_{k = 0}^\infty {\left( { - 1} \right)^k x^{2nk} } dx} = \sum\limits_{k = 0}^\infty {\left( { - 1} \right)^k \int {x^{2nk} dx} } = \sum\limits_{k = 0}^\infty {\left( { - 1} \right)^k \frac{{x^{2nk + 1} }}{{2nk + 1}}} $$ – Mohammad W. Alomari Jul 08 '15 at 23:55
  • 1
    @mwomath And a finite sum seems more elegant than an infinite series solution. Don't you agree? – Mark Viola Jul 09 '15 at 00:13
  • 1
    The most interesting part is the computation of the $a_k$'s. How do you get that result ? –  Jul 09 '15 at 07:33
  • @YvesDaoust I'll add that development in a note in the answer. – Mark Viola Jul 09 '15 at 14:08
  • @Dr.MV: wonderful. Indeed, L'Hospital makes it quasi-trivial, as opposed to the tedious evaluation of the product of remaining factors. –  Jul 09 '15 at 14:44
  • @YvesDaoust Yes. It would be quite messy to disentangle the product of remaining factors without some foresight or a lot of patience. +1 for your suggestion. – Mark Viola Jul 09 '15 at 14:46
  • Indeed a great answer. I don't get however why $\mid x_k \mid \lt 1$ as in @mwomath 's comment. By definition $\mid x_k \mid =\sqrt{x_{kr}^2+x_{ki}^2}=1$ from the identity $\sin^2a+\cos^2a=1$. Also from a geometric point of view, all roots of minus unity lie on the unit circle in the Complex Plane as analogous to the roots of unity whose modulus from the origin is $1$. Why is this inequality justified? – Paras Khosla Feb 27 '19 at 08:32
  • @ParasKhosla Who claimed that $|x_k|<1$? In fact, $|x_k|=1$. – Mark Viola Feb 27 '19 at 15:53
  • @mwomath makes use of this assumption in his comment to compute the solution as a power series. – Paras Khosla Feb 27 '19 at 16:59
  • 1
    @paraskhosla And that user's assertion that $|x_k|<1$ is not correct. But certainly for $x\in(-1,1)$, that series expansion is valid. – Mark Viola Feb 27 '19 at 18:38
  • @MarkViola It should be remarked that the real expression above is valid only for n even. For n odd, -1 is a root of the denominator, the function is not defined at that point and so neither the primitive. In that particular case the expression for the primitive will contain a real log(x+1) among its components. – TeX Apprentice Sep 11 '24 at 01:11
  • 1
    @TeXApprentice That statement is incorrect. The expression is valid for all $n\in \mathbb{N}{+}$. For example, is $n=1$, the set of antiderivatives can be written $\log(x+1)+C$. Note that $x{kr}=-1$, and $x_{ki}=0$. Thus, we have $$\int \frac1{x^1+1},dx=-\frac1{1}\sum_{n=1}^1 \frac12 (-1)\log(x^2+2x+1)+0+C'=\log(x+1)+C'$$as expected! I'm not sure what the issue is. Are you worried about the arctangent?? – Mark Viola Sep 11 '24 at 16:48
  • Yes, the $n=1$ is the easiest example to see that the formula needs some fixing for $n$ odd. In the formula in the comment above, you jut assigned $\text{arctan} \frac{x-x_{1r}}{x1i} = 0 $ but that term is undefined because $x_i =0$. arctan is not defined at that point.

    The first person to do this integral was Ramanujan, and you can see on his second Notebook, page 90, that even him, was careful to provide one formula for even $n$ and another for odd $n$., in the previous page. For notebook go to http://web.archive.org/web/20160310002228/http://www.math.tifr.res.in/~publ/nsrBook2.pdf

    – TeX Apprentice Sep 13 '24 at 06:38
  • 1
    @TeXApprentice Again, your statement is false. It is the product $x_{ki}\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)$ that is taken to be equal to zero when $x_{ki}=0$. One may define the arctangent to be $\pm \pi/2$ when its argument is $\pm \infty$. Moreover, there is a removeable discontinuity of the product as $k\to n$, $n$ odd. So, there is not a problem here at all. It is a simple interpretation of the product, NOT the arctangent, which is a bounded function. – Mark Viola Sep 13 '24 at 15:09
  • It is some other function then, defined in some other space -- like a compactification of the real line. arctan is defined on the real line and does NOT take any value at $\pm \infty$ which are NOT part of the real line. You cannot define a function on a point that is NOT on the domain. – TeX Apprentice Sep 13 '24 at 17:24
  • 1
    @TeXApprentice Are you familiar with the Riemann sphere? Are familar with removable discontinuties? Are you familiar with the extended real line. I suggest you move on as I do not wish to waste my time on this issue any further. – Mark Viola Sep 13 '24 at 17:52
5

It has no simple closed form, unless you also give some nice integration endpoints, such as $\int \limits _0 ^\infty$. For your curiosity, you get $x \space {}_2 F _1 (\frac 1 {2n}, 1, 1+ \frac 1 {2n}, -x ^{2n})$, where ${}_2 F _1$ is the hypergeometric function.

Alex M.
  • 35,927
  • 5
    By partial fraction decomposition, you get a linear combination of $2n$ terms $\ln(x-z_k)$, where $z_k$ is a $2n^{th}$ root of $-1$, nothing really exotic. –  Jul 08 '15 at 17:18
  • @YvesDaoust: I feel that the OP hasn't studied complex analysis yet. Plus, even with complex functions, you would still get a sum of simple terms - it depends on your taste whether you call that a closed formula or not. – Alex M. Jul 08 '15 at 17:20
  • 4
    I do, as long as the sum is finite. –  Jul 08 '15 at 18:14
0

First find $x^{2n}+1 = 0$, then split into sum of fractions $1/(x+b)$ and $1/(x^2+bx+c)$ and integrate those. I seem to have forgotten what it's called in English. Not partial integration or integration by parts. Partial fraction decomposition maybe?

mathreadler
  • 26,534
  • 1
    Partial fraction decomposition. All of these roots have nice expression in trigonometric form. So maybe the intended answer is a sum of $n$ things involving trig functions. – GEdgar Jul 08 '15 at 17:05
  • 1
    Yes, logarithms and arctan and maybe a few others. – mathreadler Jul 08 '15 at 17:13