## bookmark_borderEuler Sums involving square of Harmonic numbers

In my previous post on Euler sums, we evaluated sums containing $H_n$ and $H_n^{(2)}$. In this post, we’ll derive some further results using the integral $\int_0^x \frac{\log^3(1-t)}{t}dt$. Our starting point is the following generating function identity: $$\sum_{n=1}^\infty (H_n)^2 x^n = \frac{\log^2(1-x)+\text{Li}_2(x)}{1-x} ,\quad -1\leq x < 1$$ This can derived by plugging $H_n = \int_0^1\frac{1-t^n}{1-t}dt$ and interchanging the sum and the integral. We can rewrite the above equation using the fact that $\sum_{n=1}^\infty H_n^{(2)} x^n = \frac{\text{Li}_2(x)}{1-x}$. $$\sum_{n=1}^\infty (H_n)^2 x^n = \frac{\log^2(1-x)}{1-x} + \sum_{n=1}^\infty H_n^{(2)} x^n , \quad -1\leq x < 1 \quad \color{blue}{\cdots (1)}$$

## 1. Evaluation of $\int_0^x \frac{\log^n(1-t)}{t}dt$

In this section, we will derive a formula for the integral $\int_0^x \frac{\log^n(1-t)}{t}dt$ where $n$ is a positive integer. First, we’ll consider the case when $0\leq x < 1$. We have: \begin{aligned} \int_0^x \frac{\log^n (1-t)}{t}dt &= \int_0^{-\log(1-x)} \frac{t^n e^{-t}}{1-e^{-t}}dt \quad (t\mapsto 1-e^{-t}) \\ &= \sum_{j=1}^\infty \int_0^{-\log(1-x)}t^n e^{-jt} dt \\ &= -\sum_{j=1}^\infty \left[e^{-jt}\sum_{i=0}^n \frac{(-1)^{n-i}\log^{n-i}(1-x)}{j^{i+1}}n^{\underline{i}} \right]_0^{-\log(1-x)} \\ &= - \sum_{j=1}^\infty \left( (1-x)^j \sum_{i=0}^n \frac{(-1)^{n-i}\log^{n-i}(1-x)}{j^{i+1}}n^{\underline{i}}-\frac{n!}{j^{n+1}} \right) \\ &= n! \zeta(n+1) + \sum_{i=0}^n (-1)^{n-i+1} n^{\underline{i}}\log^{n-i}(1-x) \text{Li}_{i+1}(1-x) \\ &\quad \color{blue}{\cdots (2)} \end{aligned}

A similar calculation shows that for $-1\leq x < 0$, we have: \begin{aligned} \int_x^0 \frac{\log^n(1-t)}{t}dt &= -\frac{\log^{n+1}(1-x)}{n+1} - n! \zeta(n+1) + \sum_{i=0}^{n} n^{\underline{i}}\log^{n-i}(1-x)\text{Li}_{i+1}\left(\frac{1}{1-x}\right) \\ &\quad \color{blue}{\cdots (3)} \end{aligned}

## 2. Sums with $(H_n)^2$

We can divide equation (1) by $x$ and integrate both sides to get some interesting results. \begin{aligned} \sum_{n=1}^\infty \frac{(H_n)^2}{n}x^n &= -\frac{\log^3(1-x)}{3}-\log(1-x)\text{Li}_2(x)+\text{Li}_3(x), \quad -1\leq x < 1\quad \color{blue}{\cdots (4)} \\ \sum_{n=1}^\infty \frac{(H_n)^2}{n^2}x^n &= \text{Li}_4(x) + \frac{\text{Li}_2^2(x)}{2}-\frac{1}{3}\int_0^x \frac{\log^3(1-t)}{t}dt, \quad -1\leq x \leq 1\quad \color{blue}{\cdots (5)} \end{aligned} Equations (4) was obtained with the help of results from section (4) of this post.

One can now plug in $x=-1$ in equation (5) to get: $$\boxed{\sum_{n=1}^\infty \frac{(H_n)^2}{n^2}(-1)^{n+1} = \frac{41\pi^4}{1440} + \frac{\pi^2 \log^2(2)}{12}-\frac{\log^4(2)}{12}-\frac{7}{4}\log(3)\zeta(3)-2\text{Li}_2\left(\frac{1}{2}\right)}$$ Of course, equation (3) was used to evaluate $\int_{-1}^0 \frac{\log^3(1-t)}{t}dt$.

## bookmark_borderAn alternating Euler Sum

In this post, we will evaluate the famous Euler sum: $$\sum_{n=1}^\infty (-1)^{n+1}\frac{H_n}{n^3}\quad \color{blue}{\cdots (*)}$$ where $H_n = \sum_{k=1}^n \frac{1}{k}=\int_0^1 \frac{1-t^n}{1-t}dt$ is the $n$-th harmonic number. This series resists contour integration techniques which makes it’s computation quite challenging. We will start with the following well known generating function identity: $$\sum_{n=1}^\infty H_n t^n = -\frac{\log(1-t)}{1-t} ,\quad -1 \leq t < 1$$ Dividing the above equation by $t$ and integrating both sides, gives us: \begin{aligned} \sum_{n=1}^\infty H_n \frac{x^n}{n} &= -\int_0^x\frac{\log(1-t)}{t(1-t)}dt \\ &= -\int_0^x \left(\frac{1}{t} + \frac{1}{1-t} \right)\log(1-t) \; dt \\ &= \text{Li}_2(x) + \frac{1}{2}\log^2(1-x) \end{aligned} where $-1\leq x < 1$.

## 1. Computation of $\sum_{n=1}^\infty \frac{H_n}{n^2}x^n$

Now, we will use the same process to evaluate $\sum_{n=1}^\infty \frac{H_n}{n^2}x^n$ but we’ll have to divide the evaluation into two parts.

(I) First consider the case when $0 \leq x < 1$. Actually, we don’t need this case for evaluating (*) but I’ll do it anyway for completeness. We have: \begin{aligned} \sum_{n=1}^\infty \frac{H_n}{n^2} x^n &= \int_0^x\left(\frac{\text{Li}_2(t)}{t} + \frac{1}{2}\frac{\log^2(1-t)}{t}\right)dt \\ &= \text{Li}_3(x) + \frac{1}{2}\int_0^x \frac{\log^2(1-t)}{t} dt \\ &= \text{Li}_3(x) + \frac{1}{2}\int_{\log(1-x)}^0 \frac{t^2 e^t}{1-e^t}dt \quad (t\mapsto 1-e^t) \\ &= \text{Li}_3(x) + \frac{1}{2}\sum_{n=1}^\infty \int_{\log(1-x)}^0 t^2 e^{nt} \; dt \\ &= \text{Li}_3(x) + \frac{1}{2}\sum_{n=1}^\infty \left(\frac{2}{n^3} -\frac{\log^2(1-x)}{n}(1-x)^n+\frac{2\log(1-x)}{n^2}(1-x)^n-2\frac{(1-x)^n}{n^3}\right) \\ &= \text{Li}_3(x) + \frac{\log^2(1-x)\log(x)}{2} + \log(1-x)\text{Li}_2(1-x) - \text{Li}_3(1-x) + \zeta(3) \quad\color{blue}{\cdots (1)} \end{aligned} (II) Similarly, for the case $-1\leq x < 0$, we obtain:

\begin{aligned} \sum_{n=1}^\infty \frac{H_n}{n^2}x^n &= \text{Li}_3(x) -\frac{1}{2}\int_x^0 \frac{\log^2(1-t)}{t}dt \\ &= \text{Li}_3(x) +\frac{1}{2}\int_{0}^{-x} \frac{\log^2(1+t)}{t}dt \quad (t\mapsto -t) \\ &= \text{Li}_3(x) +\frac{1}{2}\int_{0}^{\log(1-x)} \frac{t^2 e^t}{e^t-1}dt \quad (t\mapsto e^t-1) \\ &= \text{Li}_3(x) +\frac{1}{2} \sum_{n=0}^\infty \int_0^{\log(1-x)} t^2 e^{-nt} dt \\ &= \text{Li}_3(x) +\frac{\log^3(1-x)}{6} + \frac{1}{2}\sum_{n=1}^\infty \int_0^{\log(1-x)} t^2 e^{-nt} dt \\ &= \text{Li}_3(x) +\frac{\log^3(1-x)}{6} + \frac{1}{2}\sum_{n=1}^\infty \left(\frac{2}{n^3} -\log^2(1-x)\frac{(1-x)^{-n}}{n}-2\log(1-x)\frac{(1-x)^{-n}}{n^2}-2\frac{(1-x)^{-n}}{n^3}\right) \\ &= \text{Li}_3(x) -\frac{\log^3(1-x)}{3} +\frac{\log^2(1-x)\log(-x)}{2} -\log(1-x)\text{Li}_2\left( \frac{1}{1-x}\right)-\text{Li}_3\left(\frac{1}{1-x}\right)+\zeta(3) \\ &\quad\color{blue}{\cdots (2)} \end{aligned}

## 2. Evaluation of $\sum_{n=1}^\infty \frac{H_n}{n^3}x^n$

This is the hardest step in the evaluation. Once again, we will divide the evaluation into two parts.

(I) Like section 1, we’ll first consider the case when $0\leq x < 1$.

Using integration by parts, we obtain: \begin{aligned} \int_0^x \frac{\zeta(3)-\text{Li}_3(1-t)}{t}dt &= \log(t)\left(\zeta(3)-\text{Li}_3(1-t) \right) \Big|_{0}^x - \int_0^x \frac{\log(t)\text{Li}_2(1-t)}{1-t}dt \\ &= \log(x)\left(\zeta(3)-\text{Li}_3(1-x) \right) - \frac{1}{2}\text{Li}_2^2 (1-x) + \frac{\zeta^2 (2)}{2} \quad \color{blue}{\cdots (3)} \end{aligned}

\begin{aligned} \int_0^x \frac{\log(1-t)\text{Li}_2(1-t)}{t}dt &= \log(t)\log(1-t)\text{Li}_2(1-t) \Big|_0^x - \int_0^x \log(t) \left(\frac{-\text{Li}_2(1-t)}{1-t} + \frac{\log(1-t)\log(t)}{1-t}\right)dt \\ &= \log(x)\log(1-x)\text{Li}_2(1-x) + \frac{1}{2}\text{Li}_2^2(1-x)-\frac{\zeta^2(2)}{2} - \int_0^x \frac{\log^2(t) \log(1-t)}{1-t}dt \\ &\quad \color{blue}{\cdots (4)} \end{aligned}

\begin{aligned} \int_0^x \frac{\log(t)\log^2(1-t)}{2t}dt &= \frac{1}{4}\log^2(t)\log^2(1-t)\Big|_0^x +\frac{1}{2}\int_0^x \frac{\log^2(t)\log(1-t)}{1-t}dt \\ &= \frac{1}{4}\log^2(x)\log^2(1-x) +\frac{1}{2}\int_0^x \frac{\log^2(t)\log(1-t)}{1-t}dt \quad \color{blue}{\cdots (5)} \end{aligned}

Putting together the results of equations (3), (4) and (5) gives us: \begin{aligned} \sum_{n=1}^\infty \frac{H_n}{n^3}x^n &= \text{Li}_4(x) +\frac{1}{4}\log^2(x)\log^2(1-x) + \log(x)\log(1-x)\text{Li}_2(1-x)\\ &\quad + \log(x)\left(\zeta(3)-\text{Li}_3(1-x) \right) -\frac{1}{2}\int_0^x \frac{\log^2(t)\log(1-t)}{1-t}dt \quad \color{blue}{\cdots (6)} \end{aligned}

(II) Now, let $-1\leq x < 0$. We have: \begin{aligned} -\int_x^0 \frac{\zeta(3)-\text{Li}_3\left(\frac{1}{1-t}\right)}{t}dt &= \int_0^{\frac{-x}{1-x}}\frac{\zeta(3)-\text{Li}_3(1-t)}{t(1-t)}dt \quad \left(t\mapsto\frac{-t}{1-t} \right)\\ &= \int_0^{\frac{-x}{1-x}}\frac{\zeta(3)-\text{Li}_3(1-t)}{t}dt + \int_0^{\frac{-x}{1-x}}\frac{\zeta(3)-\text{Li}_3(1-t)}{1-t}dt \\ &= \log\left(\frac{-x}{1-x}\right)\left(\zeta(3) - \text{Li}_3\left(\frac{1}{1-x}\right) \right) - \frac{1}{2}\text{Li}_2^2\left(\frac{1}{1-x}\right) + \frac{\zeta^2(2)}{2} \\ &\quad + \zeta(3)\log(1-x) + \text{Li}_4\left(\frac{1}{1-x} \right) - \zeta(4) \quad \color{blue}{\cdots (7)} \end{aligned} Here, we used equation (3) to simplify the integral after the transformation. Similarly, we obtain: \begin{aligned} \int_x^0 \frac{\log(1-t)\text{Li}_2\left(\frac{1}{1-t}\right)}{t}dt &= \int_0^{\frac{-x}{1-x}}\frac{\log(1-t)\text{Li}_2(1-t)}{t(1-t)}dt \\ &= \int_0^{\frac{-x}{1-x}}\frac{\log(1-t)\text{Li}_2(1-t)}{t}dt + \int_0^{\frac{-x}{1-x}}\frac{\log(1-t)\text{Li}_2(1-t)}{1-t}dt \\ &= -\log\left(\frac{-x}{1-x} \right)\log(1-x)\text{Li}_2\left(\frac{1}{1-x}\right)+\frac{1}{2}\text{Li}_2^2\left(\frac{1}{1-x}\right)-\frac{\zeta^2(2)}{2} \\ &\quad +\text{Li}_4\left(\frac{1}{1-x}\right)+\log(1-x)\text{Li}_3\left(\frac{1}{1-x}\right) -\zeta(4) \\ &\quad -\int_0^{\frac{-x}{1-x}}\frac{\log^2(t)\log(1-t)}{1-t}dt \quad \color{blue}{\cdots (8)} \end{aligned}

\begin{aligned} \int_x^0 \left( \frac{\log^3(1-t)}{3t} - \frac{\log^2(1-t)\log(-t)}{2t}\right) dt &= \frac{1}{6}\log^3(1-x)\log\left(\frac{-x}{1-x}\right) + \frac{1}{24}\log^4(1-x) \\ &\quad +\frac{1}{4}\log^2\left(\frac{-x}{1-x}\right)\log^2(1-x) + \frac{1}{2}\int_0^{\frac{-x}{1-x}}\frac{\log^2(t)\log(1-t)}{1-t}dt \\ &\quad \color{blue}{\cdots (9)} \end{aligned}

Finally, putting these results together gives:

\begin{aligned} \sum_{n=1}^\infty \frac{H_n}{n^3}x^n &= \text{Li}_4(x) + 2\text{Li}_4\left( \frac{1}{1-x}\right) + \log\left(\frac{-x}{1-x} \right)\left(-\text{Li}_3\left(\frac{1}{1-x}\right) +\frac{\log^3(1-x)}{6}-\log(1-x)\text{Li}_2\left(\frac{1}{1-x} \right)\right) \\ &\quad + \log(1-x)\text{Li}_3\left(\frac{1}{1-x}\right) + \frac{\log^4(1-x)}{24} +\frac{1}{4}\log^2 \left(\frac{-x}{1-x}\right)\log^2(1-x) +\zeta(3) \log(-x)- 2\zeta(4) \\ &\quad -\frac{1}{2}\int_0^{\frac{-x}{1-x}}\frac{\log^2(t)\log(1-t)}{1-t}dt \quad \color{blue}{\cdots (10)} \end{aligned}

The integral $\int \frac{\log^2(t)\log(1-t)}{1-t}dt$ can be evaluated in terms of Polylogarithms (refer section 7.6 of “Polylogarithms and Associated Functions” by Leonard Lewin). But it turns out that for evaluating (*) such a calculation is not needed.

## 3. Evaluation of $\int_0^{\frac{1}{2}}\frac{\log^2(t)\log(1-t)}{1-t}dt$

Let $I=\int_0^{1}\frac{\log^2(t)\log(1-t)}{1-t}dt$ and $J=\int_0^{\frac{1}{2}}\frac{\log^2(t)\log(1-t)}{1-t}dt$. The integral, $I$, can be evaluated by the differentiation under the integral technique. \begin{aligned} I &= \lim_{y\to 0^+}\lim_{x\to 1}\frac{\partial^2 }{\partial x^2} \frac{\partial }{\partial y} \int_0^1 t^{x-1} (1-t)^{y-1} dt \\ &= \lim_{y\to 0^+}\lim_{x\to 1}\frac{\partial^2 }{\partial x^2} \frac{\partial }{\partial y} \left\{\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} \right\} \end{aligned} It takes a bit of effort to compute the derivatives in terms of Polygamma functions so I won’t write the details here. One can verify that the end result is: $$I = -\frac{\pi^4}{180}$$ Now, apply integration by parts to the integral $J$: \begin{aligned} J &= \int_0^{\frac{1}{2}}\frac{\log^2(t)\log(1-t)}{1-t}dt \\ &= -\frac{\log^2(t)\log^2(1-t)}{2}\Big|_0^{\frac{1}{2}} + \int_0^{\frac{1}{2}} \frac{\log(t)\log^2(1-t)}{t}dt \\ &= -\frac{\log^4(2)}{2} + \int_{\frac{1}{2}}^1 \frac{\log^2(t)\log(1-t)}{1-t}dt \quad (t\mapsto 1-t)\\ &= -\frac{\log^4(4)}{2} + I-J \end{aligned} Now, one can solve the above equation for $J$ to get: \begin{aligned} J &= -\frac{\log^4(2)}{4}+\frac{I}{2} \\ &= -\frac{\log^4(2)}{4}-\frac{\pi^4}{360} \end{aligned}

Finally, we have every thing needed to evaluate (*). Plugging in $x=-1$ in equation (10) and performing some simplifications gives us the beautiful result: $$\boxed{\sum_{n=1}^\infty \frac{H_n}{n^3}(-1)^{n+1} = \frac{11\pi^4}{360}+\frac{\pi^2}{12}\log^2(2)-\frac{\log^4(2)}{12}-\frac{7}{4}\log(2)\zeta(3) -2\text{Li}_4\left(\frac{1}{2}\right)}$$ A similar result is obtained by plugging $x=\frac{1}{2}$ into equation (6): $$\boxed{\sum_{n=1}^\infty \frac{H_n}{n^3 2^n}= \frac{\pi^4}{720}+\frac{\log^4(2)}{24}-\frac{1}{8}\log(2)\zeta(3) +\text{Li}_4\left(\frac{1}{2}\right)}$$

## 4. Further Results

Let $H_n^{(2)} = \zeta(2) - \psi_1(n+1) = \sum_{k=1}^n \frac{1}{k^2}$. Then, it is easy to verify that: $$\sum_{n=1}^\infty t^n H_n^{(2)} = \frac{\text{Li}_2(t)}{1-t}, \quad -1\leq t < 1$$ Now, dividing the above equation by $t$ and integrating both sides, gives us: \begin{aligned} \sum_{n=1}^\infty \frac{H_n^{(2)}}{n}x^n &= \int_0^x \text{Li}_2(t)\left( \frac{1}{t}+\frac{1}{1-t}\right) \\ &= \text{Li}_3(x) + \int_0^x \frac{\text{Li}_2(t)}{1-t} dt \\ &= \text{Li}_3(x) -\log(1-x)\text{Li}_2(x) - \int_0^x \frac{\log^2(1-t)}{t}dt \end{aligned} From our previous calculation, we know that $$\int_0^x \frac{\log^2(1-t)}{t}dt = 2\sum_{n=1}^\infty \frac{H_n}{n^2}x^n -2\text{Li}_3(x)$$ Hence, we obtain the following relation: $$\sum_{n=1}^\infty \frac{H_n^{(2)}}{n}x^n =3\text{Li}_3(x)-\log(1-x)\text{Li}_2(x) - 2\sum_{n=1}^\infty \frac{H_n}{n^2}x^n \quad \color{blue}{\cdots (11)}$$ Once again, divide the above equation by $x$ and integrate both sides to get: $$\sum_{n=1}^\infty \frac{H_n^{(2)}}{n^2}x^n = 3\text{Li}_4(x) + \frac{1}{2}\text{Li}_2^2(x) - 2\sum_{n=1}^\infty \frac{H_n}{n^3}x^n \quad \color{blue}{\cdots (12)}$$ Equations (11) and (12) are valid for $-1\leq x < 1$. Plugging in $x=\frac{1}{2}$ in equation (12) and using the known closed form for $\sum_{n=1}^\infty \frac{H_n}{n^3 2^n}$ gives us: $$\boxed{ \sum_{n=1}^\infty \frac{H_n^{(2)}}{n^2 2^n} = \frac{\pi^4}{1440}-\frac{\pi^2}{24}\log^2(2) + \frac{\log^4(2)}{24}+ \frac{1}{4}\log(2)\zeta(3) + \text{Li}_4\left(\frac{1}{2}\right) }$$