During my study of generating functions, I was able to calculate the generating function of the sequence of harmonic numbers $H_n$: $$\sum_{n=1}^\infty H_nx^n=\frac{\ln(1-x)}{x-1}$$ However, I also tried to find generating functions for $H_n^2$ and $H_n^3$, with which I was unsuccessful (the rearrangement method I used for the generating function of $H_n$ didn't reduce as nicely for $H_n^2$ and $H_n^3$).
Any hints about how to find $$\sum_{n=1}^\infty H_n^2x^n=\space ?$$ and $$\sum_{n=1}^\infty H_n^3x^n=\space ?$$ Please don't write a full answer and spoil it for me - I just want a hint.
We have that $$ f(x)=\sum_{n\geq 0}a_n x^n\quad\Longleftrightarrow\quad \frac{f(x)}{1-x}=\sum_{n\geq 0}A_n x^n $$ where $A_n = a_0+a_1+\ldots+a_n$. In order to find the OGF of $H_{n}^2$ it is enough to find the OGF of $$ H_{n+1}^2-H_{n}^2 = \left(H_{n+1}-H_n\right)\left(H_{n+1}+H_n\right)=\frac{2H_n}{n+1}+\frac{1}{(n+1)^2}, $$ and while the OGF of $\frac{1}{(n+1)^2}$ is clearly related with $\text{Li}_2(x)=\sum_{n\geq 1}\frac{x^n}{n^2}$, the OGF of $\frac{H_n}{n+1}$ can be deduced by applying termwise integration to the OGF of $H_n$. It follows that $$ \sum_{n\geq 1}H_n^2 x^n = \frac{\log^2(1-x)+\text{Li}_2(x)}{1-x}\tag{A}$$ and the (more involved) OGF of $H_n^3$ can be computed through the same trick. It is useful to consider that the Taylor series of $\log(1-x)^k$ is related to Stirling numbers of the first kind.