My textbook has the steps to prove it, but I can't comprehend the steps that the textbook are showing. Can someone explain the math or logic used going from steps red to yellow and finally green?

My textbook has the steps to prove it, but I can't comprehend the steps that the textbook are showing. Can someone explain the math or logic used going from steps red to yellow and finally green?

To get from red to yellow, note that $$(k+1)H_k = (k+1)\sum_{j=1}^k \frac{1}{j} = -(k+1)\frac{1}{k+1} + (k+1)\sum_{j=1}^{k+1}\frac{1}{j} = (k+1)\left(H_{k+1}-\frac{1}{k+1}\right).$$ To get from yellow to green, just expand: \begin{align} (k+1) \left(H_{k+1}-\frac{1}{k+1}\right) - k + H_{k+1} &= (k+1)H_{k+1} - 1 - k + H_{k+1} \\ &= (k+2)H_{k+1} - 1 - k. \end{align}