# Partial sum involving harmonic numbers

QUESTION:

I need to know how to compute the partial sum $$\sum_{k=1}^n \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}$$ in terms of the generalized harmonic numbers $H_n^{(m)}$.

CONTEXT:

This problem arose because I was trying to compute the coefficients of the Taylor series of the function $$f(z)=\ln^4(1-z)$$ And I have already computed that $$\sum_{k=1}^\infty \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}z^{k+2}=\frac{\ln^3(1-z)}{3}$$

We simplify the sum first and as follows:

\begin{align} \sum_{k=1}^n \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}&=\sum_{k=0}^n \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}=\sum_{k=1}^{n+1} \frac{H_{k}^2-H_{k}^{(2)}}{k+1}\\ &=\color{blue}{\sum_{k=1}^{n} \frac{H_{k}^2-H_{k}^{(2)}}{k+1}}+\frac{H_{n+1}^2-H_{n+1}^{(2)}}{n+2}\tag{1} \end{align}

Lets apply Abel's summation to the blue sum:

$$\displaystyle\sum_{k=1}^n a_k b_k=A_nb_{n+1}+\sum_{k=1}^{n}A_k\left(b_k-b_{k+1}\right)\$$ where $$\ \displaystyle A_n=\sum_{i=1}^n a_i\$$

and by letting let $$\ \displaystyle a_k=\frac{1}{k+1}\$$ , $$\ \displaystyle b_k=H_{k}^2-H_k^{(2)}$$, we get \begin{align} S_n&=\sum_{k=1}^{n} \frac{H_{k}^2-H_{k}^{(2)}}{k+1}\\ &\small{=\left(\sum_{i=1}^n\frac1{i+1}\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)+\sum_{k=1}^n\left(\sum_{i=1}^k\frac1{i+1}\right)\left(H_{k}^2-H_k^{(2)}-H_{k+1}^2+H_{k+1}^{(2)}\right)}\\ &=\left(H_{n+1}-1\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)+\sum_{k=1}^n\left(H_{k+1}-1\right)\left(-\frac{2H_{k}}{k+1}\right)\\ &=\left(H_{n+1}-1\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)+2\sum_{k=1}^n\frac{H_k}{k+1}-2\sum_{k=1}^n\frac{H_{k+1}H_k}{k+1}\\ &=\left(H_{n+1}-1\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)+2\left[\frac12\left(H_{n+1}^2-H_{n+1}^{(2)}\right)\right]-2\sum_{k=1}^n\frac{H_{k+1}H_k}{k+1}\\ &\boxed{=\left(H_{n+1}\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)-2\color{red}{\sum_{k=1}^n\frac{H_{k+1}H_k}{k+1}}}\tag{2}\\ \end{align}

we can simplify the red sum as follows: \begin{align} \sum_{k=1}^n\frac{H_{k+1}H_k}{k+1}&=\sum_{k=0}^n\frac{H_{k+1}H_k}{k+1}=\sum_{k=1}^{n+1}\frac{H_{k}H_{k-1}}{k}=\sum_{k=1}^{n}\frac{H_{k}H_{k-1}}{k}+\frac{H_{n+1}H_{n}}{n+1}\\ &=\sum_{k=1}^n\frac{H_k^2}{k}-\sum_{k=1}^n\frac{H_k}{k^2}+\frac{H_{n+1}H_{n}}{n+1}\\ &=\sum_{k=1}^n\frac{H_k^2}{k}-\left(H_nH_n^{(2)}+H_n^{(3)}-\sum_{k=1}^n\frac{H_k^{(2)}}{k}\right)+\frac{H_{n+1}H_{n}}{n+1}\\ &=\sum_{k=1}^n\frac{H_k^2+H_k^{(2)}}{k}-H_nH_n^{(2)}-H_n^{(3)}+\frac{H_{n+1}H_{n}}{n+1}\\ &=\frac13\left(H_n^3+3H_nH_n^{(2)}+2H_n^{(3)}\right)-H_nH_n^{(2)}-H_n^{(3)}+\frac{H_{n+1}H_{n}}{n+1}\\ &\boxed{=\frac13\left(H_n^3-H_n^{(3)}\right)+\frac{H_{n+1}H_{n}}{n+1}}\tag{3}\\ \end{align}

Plugging $$(3)$$ in $$(2)$$, we get

$$\sum_{k=1}^{n} \frac{H_{k}^2-H_{k}^{(2)}}{k+1}=\left(H_{n+1}\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)-\frac23\left(H_n^3-H_n^{(3)}\right)-\frac{2H_{n+1}H_{n}}{n+1}$$

Plugging this result in $$(1)$$, we get

$$\small{\sum_{k=1}^n \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}=\left(H_{n+1}\right)\left(H_{n+1}^2-H_{n+1}^{(2)}\right)-\frac23\left(H_n^3-H_n^{(3)}\right)-\frac{2H_{n+1}H_{n}}{n+1}+\frac{H_{n+1}^2-H_{n+1}^{(2)}}{n+2}}$$

which can be simplified into

$$\sum_{k=1}^n \frac{H_{k+1}^2-H_{k+1}^{(2)}}{k+2}=\frac13\left(H_n^3-3H_nH_n^{(2)}+2H_n^{(3)}\right)+\frac{(2n+3)(H_n^2-H_n^{(2)})+2H_n}{(n+1)(n+2)}$$