Evaluate:: $2 \sum_{n=1}^\infty \frac{(-1)^{n+1}}{n+1}\left( 1 + \frac12 +\cdots + \frac 1n\right)$

How to evaluate the series: $$2 \sum_{n=1}^\infty \frac{(-1)^{n+1}}{n+1}\left( 1 + \frac12 + \cdots + \frac 1n\right)$$

According to Mathematica, this converges to $(\log 2)^2$.

-
What is the summand when $n=0$? Is it just $-1$? Or perhaps the summation runs from $n=1$ to $n = \infty$ instead? –  Antonio Vargas Feb 2 at 18:47
For large $n$ the absolute value of adjacent terms is $n\log{(n+1)}/((n+1) \log{n}) \sim (n \log{n}+1)/(n \log{n} +n)$ which does go to zero. –  Ron Gordon Feb 2 at 18:48
For $|a_{n+1}|\leq |a_n|$, write the inequality down, multiply by $n+2$, then use $\frac{n+2}{n+1}=1+\frac{1}{n+1}$. It works. –  julien Feb 2 at 18:50
@experimentX you answered your own question... your sum is exactly equal to the product $$\left(\sum_{n=0}^{\infty} \frac{(-1)^{n+1}}{n+1}\right)^2 = (-\log 2)^2 = (\log 2)^2.$$ –  Antonio Vargas Feb 2 at 19:37
Hint: If $f(x)=(\log x)^2$, then $f^{(n+1)}(1)=2\,(-1)^{n+1}(n!)(1+\frac{1}{2}+\cdots+\frac{1}{n})$. See related question –  Michael E2 Feb 2 at 19:56

Recall that, formally,

$$\left(\sum_{n=1}^{\infty} a_n\right)\left(\sum_{n=1}^{\infty} b_n\right) = \sum_{n=1}^{\infty} c_{n+1},$$

where

$$c_n = \sum_{k=1}^{n-1} a_k b_{n-k}.$$

If the series $\sum c_{n+1}$ converges, then the above equality is actually true. You seem to know how to show this, so I'll just demonstrate the formal aspect of the problem.

Let $a_n = b_n = \frac{(-1)^{n}}{n}$. Then

$$a_k b_{n-k} = \frac{(-1)^n}{k(n-k)} = \frac{(-1)^n}{n}\left(\frac{1}{k}+\frac{1}{n-k}\right),$$

so that

\begin{align*} c_n &= \frac{(-1)^n}{n} \sum_{k=1}^{n-1} \left(\frac{1}{k}+\frac{1}{n-k}\right) \\ &= 2\frac{(-1)^n}{n} \sum_{k=1}^{n-1} \frac{1}{k}. \end{align*}

We therefore have

$$2 \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n+1} \sum_{k=1}^{n} \frac{1}{k} = \left(\sum_{n=1}^{\infty} \frac{(-1)^n}{n}\right)^2 = (-\log 2)^2 = (\log 2)^2.$$

-
wow!! i only knew one had to absolutely convergent. –  experimentX Feb 2 at 20:15
@experimentX, You may be interested in these notes (the bottom of p.4), which proves that result using Abel's theorem. –  Antonio Vargas Feb 2 at 20:29
For searching purposes: what Antonio has used here is the fact that the Cauchy product of the generating functions of two independent sequences is the generating function of the convolution of the two sequences. (+1, of course.) –  Ｊ. Ｍ. Apr 3 at 7:36

Use generating functions:

Consider $$-\log(1-x) = \sum_{n=1}^\infty \frac{x^n}{n}.$$ Dividing by $1-x$, we get $$-\frac{\log(1-x)}{1-x} = \sum_{n=1}^\infty \left(\sum_{k=1}^n \frac{1}{k}\right)x^n.$$ Integrating this and multiplying everything by $2$ gives $$\left[\log(1-x)\right]^2 = 2\sum_{n=1}^\infty \left(\sum_{k=1}^n \frac{1}{k}\right)\frac{x^{n+1}}{n+1} + C,$$ where $C$ is some constant. But we can get rid of $C$ by plugging $x=0$ into both sides, which gives $C=0$: $$\left[\log(1-x)\right]^2 = 2\sum_{n=1}^\infty \left(\sum_{k=1}^n \frac{1}{k}\right)\frac{x^{n+1}}{n+1}.$$ From here, we'd like to simply plug in $x=-1$ and say our answer is $(\log{2})^2$, but we have to first check to make sure the power series on the right actually converges there. To do this, observe that \begin{aligned} \frac{\frac{1}{n+2}\left(1+\frac{1}{2} + \cdots + \frac{1}{n+1}\right)}{\frac{1}{n+1}\left(1+\frac{1}{2} + \cdots + \frac{1}{n}\right)} &= \frac{(n+1)\left(1+\frac{1}{2} + \cdots + \frac{1}{n+1}\right)}{(n+2)\left(1+\frac{1}{2} + \cdots + \frac{1}{n}\right)}\\ &\leq \frac{(n+1)\left(1+\frac{1}{2} + \cdots + \frac{1}{n}\right)}{(n+2)\left(1+\frac{1}{2} + \cdots + \frac{1}{n}\right)}\\ &=\frac{n+1}{n+2}<1, \end{aligned} so the terms decrease in absolute value. Since they also converge to zero (they're all less than $1/(n+1)$, which converges to zero), the entire series converges by the alternating series test.

-
wow!! this is also very nice!! –  experimentX Feb 2 at 20:34
You are implicitly using Abel's theorem: en.wikipedia.org/wiki/Abel%27s_theorem –  Aryabhata Feb 2 at 20:39
Nice answer, easy way to follow! (+1) –  Chris's sis Feb 2 at 20:42

This is a special case of a more general result derived here.

$$S = \sum_{n=1}^{\infty} \dfrac{(-1)^{n+1}}{n+1} \sum_{k=1}^n \dfrac1k$$ Recall that $\dfrac1k = \displaystyle \int_0^1 x^{k-1} dx$ and $\dfrac1{n+1} = \displaystyle \int_0^1 y^n dy$.

Now use the following fact. $$\sum_{k=0}^{\infty} \int_0^1 (-z)^k dz = \lim_{n \to \infty} \int_0^1 \dfrac{1 - (-z)^n}{1+z} dz$$ The sequence of functions $f_n(z) = \dfrac{1 - (-z)^n}{1+z}$ is dominated by the function $g(z) = \dfrac2{1+z}$ in the interval $[0,1]$, which is integrable. Hence, we can swap the limit and the integral to get that $$\lim_{n \to \infty} \int_0^1 \dfrac{1 - (-z)^n}{1+z} dz = \int_0^1 \dfrac{dz}{1+z}$$

Hence, $$S = \sum_{n=1}^{\infty} (-1)^{n+1} \int_0^1 y^n dy \left(\sum_{k=1}^n \int_0^1 x^{k-1} dx \right) = \sum_{n=1}^{\infty} (-1)^{n+1} \int_0^1 y^n dy \left(\int_0^1 \dfrac{1-x^n}{1-x} dx \right)$$ Hence, $$S = \int_0^1 \int_0^1 \dfrac{\dfrac{y}{1+y} - \dfrac{xy}{1+xy}}{1-x} dy dx = \int_0^1 \int_0^1 \dfrac{y+xy^2-xy-xy^2}{(1+y)(1+xy)(1-x)} dx dy\\ =\int_0^1 \int_0^1 \dfrac{y}{(1+y)(1+xy)} dx dy = \int_0^1 \dfrac{\log(1+y)}{1+y} dy = \left. \dfrac{\log^2(1+y)}2 \right \vert_0^1 = \dfrac{\log^2(2)}2$$ The sum you are interested in is $2S$ and hence the answer is $\log^2(2)$.

-
Beautiful answer, but how do you justify swapping the infinite sum and integrals? –  PeterM Feb 2 at 21:49
@PeterM I have clarified this by updating the answer. Let me know if I have missed something out. –  ShikariShambu Feb 2 at 22:08
sweet indeed - there's a small typo $\sum_{k=0}^{\infty} \int_0^1 (-z)^k dy$ should be $\sum_{k=0}^{\infty} \int_0^1 (-z)^k dz$ –  nikola Feb 6 at 17:54
@nikola Thanks. Corrected. –  ShikariShambu Feb 6 at 17:58
@Marvis Perfect. Thank you! –  PeterM Feb 6 at 23:13