# On calculating $\int_0^1\ln(1-x^2)\;{\mathrm dx}$ — where is the mistake?

I've seen the integral $\displaystyle \int_0^1\ln(1-x^2)\;{dx}$ on a thread in this forum and I tried to calculate it by using power series. I wrote the integral as a sum then again as an integral. Here is my calculation:

\displaystyle \begin{aligned} \int_0^1 \ln\left(1-x^2\right)\;{\mathrm dx} & = -\int_0^1\sum_{k \ge 0}\frac{x^{2k+2}}{k+1}\;{\mathrm dx} = -\sum_{k \ge 0}\int_{0}^{1}\frac{x^{2k+2}}{k+1}\;{\mathrm dx} \\& = -\sum_{k \ge 0}\bigg[\frac{x^{2k+3}}{(k+1)(2k+3)}\bigg]_0^1 = -\sum_{k \ge 0}\frac{1}{(k+1)(2k+3)} \\& = -\sum_{k \ge 0}\frac{(2k+3)-2(k+1)}{(k+1)(2k+3)} = -\sum_{k\ge 0}\bigg(\frac{1}{k+1}-\frac{2}{2k+3}\bigg) \\& \color{blue}{= -\sum_{k\ge 0}\int_0^1\bigg(x^{k}-2x^{2k+2}\bigg)\;{\mathrm dx} = -\int_0^1\sum_{k\ge 0}\bigg( x^{k}-2x^{2k+2}\bigg)\;{\mathrm dx}} \\&= \int_0^1\frac{1}{1+x}-2\;{\mathrm dx} = \bigg[\ln(1+x)-2x\bigg]_0^1 = \ln{2}-2.\end{aligned}

I should have got $2\ln{2}-2$, not $\ln{2}-2$. I'm thinking that either I made a very silly mistake, or the blue step is wrong (probably the order cannot be switched, although I don't know why)!

-
+1 for "thinking outside the box", then showing some work. I would do +more if I could. – Ross Millikan Mar 16 '11 at 3:48
How did you go from $\sum(x^k-2x^{k+2})$ to $\frac{1}{1+x}-2$? If I think about $\sum x^k$, this converges to $\frac{1}{1-x}$; and $\sum x^{2k+2} = \sum(x^2)^{k+1}$ converges to $\frac{1}{1-x^2}-1 = \frac{x^2}{1-x^2}$. So shouldn't the entire thing thing go to $\frac{1}{1-x}-\frac{2x^2}{1-x^2} = \frac{1+x-2x^2}{1-x^2}$? – Arturo Magidin Mar 16 '11 at 3:52
@Arturo Magidin: Yes -- and that's $\frac{(1+2x)(1-x)}{(1+x)(1-x)}=\frac{1+2x}{1+x}=\frac{1}{1+x}-2$. – joriki Mar 16 '11 at 3:54
@Arturo $-\int_0^1 \frac{1}{1-x} dx - \int_0^1 \frac{2x^2}{1-x^2} dx$ $= -\int_0^1 \frac{1}{1-x} dx - \int_0^1 2\left(-1 - \frac{1}{2 (-1 + x)} + \frac{1}{2 (1 + x)}\right)dx$ I am too eager to know what is wrong with OPs approach – Please Delete Account Mar 16 '11 at 3:57
@StudentOfMaths, @joriki, @Approximist: Okay, thanks. – Arturo Magidin Mar 16 '11 at 3:57

This is quite interesting. I think the problem does lie in the blue line. The sum over $\frac{1}{k+1}-\frac{2}{2k+3}$ converges absolutely, but the sums over the two terms individually diverge. What you're doing when you combine the two series as you do is effectively to move the terms $\frac{2}{2k+3}$ back to twice the $k$ value from where they belong, and that's a different series; you can only do that when the two terms absolutely converge individually.

What you're effectively calculating by "slowing down" $k$ in the second term is

$$-\sum_{k\ge0}\left(\frac{1}{2k+1}+\frac{1}{2k+2}-\frac{2}{2k+3}\right)\;,$$

and that is indeed $\ln 2 - 2$.

[Update]

The above explanation refers to the series above the blue line to show that exchanging the sum and integral in the blue line can't be valid. But of course that should also be decidable from just the blue line itself.

First off, note that actually the first step after the blue line isn't quite right, either: At $x=1$, the sum in the integrand actually diverges to $-\infty$, so the value $-3/2$ of the integrand in the last line for $x=1$ is obtained by rearranging a divergent series. But that problem only occurs at $x=1$; for all other values of $x$, the series converges absolutely and may validly be arranged to obtain the integrand in the last line. But this discontinuity at $x=1$ already shows that the partial sums don't converge uniformly. Indeed

$$-\sum_{k=0}^{n-1}\left(x^k-2x^{2k+2}\right)=-\frac{1-x^n}{1-x}+2x^2\frac{1-x^{2n}}{1-x^2}=\frac{1-x^n}{1-x}\left(-1+2x^2\frac{1+x^n}{1+x}\right)\;,$$

which for large $n$ is close to the integrand in the last line for most $x$ but close to $x=1$ suddenly becomes positive and ends up at $n$ for $x=1$, as it must. Here's a plot for $n=100$.

Here's a very nice general treatment of the interchange of limits based on uniform convergence, which can be applied to integrals, derivatives and sums alike. Since the series in the integrand diverges at $x=1$, we have to treat the integral as a limit taking the upper integration limit to $1$, and this limiting operation and the one in the series can only be interchanged if the uniform convergence criterion is fulfilled.

(Here's another example where an integral and a function limit can't be interchanged due to lack of uniform convergence; this one is a bit simpler because there's no sum involved.)

-
Good observation! I hadn't noticed that the series was being rearranged, which if it does not converge absolutely allows one to give it an arbitrary value. – Alex Becker Mar 16 '11 at 6:12
Many thanks, Joriki. Part of what was bugging me is that the same exact method works for the sister integral $\int \ln(1+x^2)\;{dx}$ and gives its value correctly as $\ln{2}+\frac{1}{2}\pi-2$. Now I see why it works for it (in its 'blue step', the sums over the two terms individually converge). – Lyrebird Mar 16 '11 at 23:26
@Alex @StudentOfMaths @Approximist @Arturo Magidin: I expanded the answer to explain the failure of the interchange in the blue line from just the blue line by itself, without reference to the series it's trying to evaluate. – joriki Mar 19 '11 at 19:48

Why not try splitting $\ln(1-x^2)$ as $\ln(1-x)+\ln(1+x)$ before applying the Mercator series?

-
That's exactly what was done in the first line, canceling the odd order terms. Those series are less convergent than the original, so I don't think this is progress. – Ross Millikan Mar 16 '11 at 3:43

\begin{eqnarray*} \int_{0}^{1}\ln\left(1 - x^{2}\right)\,{\rm d}x & = & \int_{0}^{1}\sum_{\sigma = \pm}\ln\left(1 + \sigma\,x\right)\,{\rm d}x = \sum_{\sigma = \pm}\int_{\sigma}^{1 + \sigma}\ln\left(\sigma\,x\right)\,{\rm d}x \\ & = & \sum_{\sigma = \pm}\sigma\int_{1}^{1 + \sigma}\ln\left(x\right)\,{\rm d}x = \sum_{\sigma = \pm}\sigma\,\left\lbrace% \left.x\ln\left(x\right)\vphantom{\Large A}\right\vert_{1}^{1 + \sigma} - \int_{1}^{1 + \sigma}x\,{1 \over x}\,{\rm d}x \right\rbrace \\ & = & \sum_{\sigma = \pm}\sigma\left\lbrack\vphantom{\Large A}% \left(1 + \sigma\right)\ln\left(1 + \sigma\right) - \sigma\right\rbrack = \sum_{\sigma = \pm}\left\lbrack\vphantom{\Large A}% \left(\sigma + 1\right)\ln\left(1 + \sigma\right) - 1\right\rbrack \\ & = & \left\lbrace\underbrace{\quad\lim_{x \to 0}\left\lbrack\vphantom{\Large A} x\ln\left(x\right)\right\rbrack\quad}_{=\ 0} - 1\right\rbrace\ +\ \left\lbrace\left(1 + 1\right)\ln\left(1 + 1\right) - 1\vphantom{\Huge A}\right\rbrace \\[1cm]&&\mbox{} \end{eqnarray*}

$$\int_{0}^{1}\ln\left(1 - x^{2}\right)\,{\rm d}x = {\large 2\ln\left(2\right) - 2}$$

-
This does not answer the question "where is the mistake?" – Did Aug 18 '13 at 17:30
The "blue one" is not correct. The integral of $\left(1 - x^{2}\right)^{-1}$ diverges. The trick involves two harmonic series and they have to be splited to acomplish the "wrong task". Indeed, they involve digamma functions. – Felix Marin Aug 18 '13 at 17:51