# Summation to n of Square of kth Harmonic Number

## Theorem

$\displaystyle \sum_{k \mathop = 1}^n {H_k}^2 = \left({n + 1}\right) {H_n}^2 - \left({2 n - 1}\right) H_n + 2 n$

where $H_k$ denotes the $k$th harmonic number.

## Proof

Using Summation by Parts:

$(1): \quad \displaystyle \sum_{k \mathop = 1}^n {H_k}^2 = n {H_n} - \sum_{k \mathop = 1}^{n - 1} k \left({ {H_{k + 1} }^2 - {H_k}^2}\right)$

Then:

 $\displaystyle \dfrac { {H_{k + 1} }^2 - H_{k + 1}^{\left({2}\right)} } 2$ $=$ $\displaystyle \sum_{j \mathop = 1}^k \dfrac {H_j} {j + 1}$ Summation to n of kth Harmonic Number over k+1 $\displaystyle \leadsto \ \$ $\displaystyle {H_{k + 1} }^2$ $=$ $\displaystyle 2 \sum_{j \mathop = 1}^k \dfrac {H_j} {j + 1} + H_{k + 1}^{\left({2}\right)}$

and:

 $\displaystyle \dfrac { {H_k}^2 - H_k^{\left({2}\right)} } 2$ $=$ $\displaystyle \sum_{j \mathop = 1}^{k - 1} \dfrac {H_j} j$ Summation to n of kth Harmonic Number over k+1 $\displaystyle \leadsto \ \$ $\displaystyle {H_k}^2$ $=$ $\displaystyle 2 \sum_{j \mathop = 1}^{k - 1} \dfrac {H_j} {j + 1} + H_k^{\left({2}\right)}$

Thus:

 $\displaystyle {H_{k + 1} }^2 - {H_k}^2$ $=$ $\displaystyle \left({2 \sum_{j \mathop = 1}^k \dfrac {H_j} {j + 1} + H_{k + 1}^{\left({2}\right)} }\right) - \left({2 \sum_{j \mathop = 1}^{k - 1} \dfrac {H_j} {j + 1} + H_k^{\left({2}\right)} }\right)$ $\displaystyle$ $=$ $\displaystyle 2 \sum_{j \mathop = 1}^k \dfrac {H_j} {j + 1} - 2 \sum_{j \mathop = 1}^{k - 1} \dfrac {H_j} {j + 1} + H_{k + 1}^{\left({2}\right)} - H_k^{\left({2}\right)}$ $(2):\quad$ $\displaystyle$ $=$ $\displaystyle 2 \dfrac {H_k} {k + 1} + \frac 1 {\left({k + 1}\right)^2}$ Definition of General Harmonic Numbers

So:

 $\displaystyle \sum_{k \mathop = 1}^n {H_k}^2$ $=$ $\displaystyle n H_n - \sum_{k \mathop = 1}^{n - 1} k \left({ 2 \dfrac {H_k} {k + 1} + \frac 1 {\left({k + 1}\right)^2} }\right)$ substituting for $(2)$ in $(1)$ $\displaystyle$ $=$ $\displaystyle n H_n - \sum_{k \mathop = 1}^{n - 1} \left({1 - \frac 1 {k + 1} }\right) \left({2 H_k + \frac 1 {k + 1} }\right)$ factoring $\dfrac k {k + 1} = 1 - \dfrac 1 {k + 1}$ $\displaystyle$ $=$ $\displaystyle n H_n - 2 \sum_{k \mathop = 1}^{n - 1} H_k + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - \sum_{k \mathop = 1}^{n - 1} \frac 1 {k + 1} + \sum_{k \mathop = 1}^{n - 1} \frac 1 {\left({k + 1}\right)^2}$ splitting up $\displaystyle$ $=$ $\displaystyle n H_n - 2 \sum_{k \mathop = 1}^{n - 1} H_k + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - \sum_{k \mathop = 2}^n \frac 1 k + \sum_{k \mathop = 2}^n \frac 1 {k^2}$ Translation of Index Variable of Summation $\displaystyle$ $=$ $\displaystyle n H_n - 2 \sum_{k \mathop = 1}^{n - 1} H_k + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - \left({\sum_{k \mathop = 1}^n \frac 1 k - \frac 1 1}\right) + \left({\sum_{k \mathop = 1}^n \frac 1 {k^2} - \frac 1 {1^2} }\right)$ $\displaystyle$ $=$ $\displaystyle n H_n - 2 \sum_{k \mathop = 1}^{n - 1} H_k + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - \sum_{k \mathop = 1}^n \frac 1 k + \sum_{k \mathop = 1}^n \frac 1 {k^2}$ simplification $\displaystyle$ $=$ $\displaystyle n H_n - 2 \sum_{k \mathop = 1}^{n - 1} H_k + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - H_n + H_n^{\left({2}\right)}$ Definition of Harmonic Numbers and Definition of General Harmonic Numbers $\displaystyle$ $=$ $\displaystyle n H_n - 2 \left({n H_{n - 1} - \left({n - 1}\right)}\right) + 2 \sum_{k \mathop = 1}^{n - 1} \frac {H_k} {k + 1} - H_n + H_n^{\left({2}\right)}$ Sum of Sequence of Harmonic Numbers $\displaystyle$ $=$ $\displaystyle n H_n - 2 \left({n H_{n - 1} - \left({n - 1}\right)}\right) + 2 \left({\dfrac { {H_{n + 1} }^2 - H_{n + 1}^{\left({2}\right)} } 2}\right) - H_n + H_n^{\left({2}\right)}$ Summation to n of kth Harmonic Number over k+1 $\displaystyle$ $=$ $\displaystyle n H_n - 2 n H_{n - 1} + 2 n - 2 + {H_{n + 1} }^2 - H_{n + 1}^{\left({2}\right)} - H_n + H_n^{\left({2}\right)}$ multiplying out $\displaystyle$ $=$ $\displaystyle n \left({H_n - H_{n - 1} }\right) - n H_{n - 1} + 2 n - 2 + {H_{n + 1} }^2 - \frac 1 {\left({n + 1}\right)^2} - H_n$ elimination of $H_{n + 1}^{\left({2}\right)} - H_n^{\left({2}\right)}$ $\displaystyle$ $=$ $\displaystyle n \left({\frac 1 n}\right) - n H_{n - 1} + 2 n - 2 + {H_{n + 1} }^2 - \frac 1 {\left({n + 1}\right)^2} - H_n$ elimination of $H_n - H_{n - 1}$ $\displaystyle$ $=$ $\displaystyle 2 n - 1 - n H_{n - 1} + {H_{n + 1} }^2 - \frac 1 {\left({n + 1}\right)^2} - H_n$ further tidying