I tried using generating functions to solve the sum of squares formula based on the recurrence $a_n = a_{n-1} + n^2$ with $a_0 = 0$.
$$G(x) = \sum_{n=0}^{\infty} a_n x^n \\ G(x) - 0 = \sum_{n=1}^{\infty} (a_{n-1} + n^2) x^n \\ G(x) = \sum_{n=1}^{\infty} a_{n-1}x^n + \sum_{n=1}^{\infty} n^2 x^n \\ G(x) = x\sum_{n=0}^{\infty} a_{n}x^n + (-0^2x^0 + \sum_{n=0}^{\infty} n^2 x^n) \\ G(x) = xG(x) + \sum_{n=0}^{\infty} n^2 x^n \\ G(x) = xG(x) + \frac{x(x+1)}{(1-x)^3} \\ G(x) = \frac{x(x+1)}{(1-x)^4} \\ G(x) = \frac{0}{(1-x)^1} + \frac{1}{(1-x)^2} - \frac{3}{(1-x)^3} + \frac{2}{(1-x)^4} \\ G(x) = \frac{1}{(1-x)^2} - 3\frac{1}{(1-x)^3} + 2\frac{1}{(1-x)^4} $$
Once I get to a spot like this I am unsure how to proceed. What is the smart way to solve the rest of this if you haven't seen a particular type of generating function before?
It is convenient to obtain the coefficients already from \begin{align*} G(x)=\frac{x(x+1)}{(1-x)^4} \end{align*}
Comment:
In (1) we use the binomial series representation
In (2) we use the linearity of the coefficient of operator and $[x^n]x^kG(x)=[x^{n-k}]G(x)$. We also use the binomial formula $\binom{-n}{k}=\binom{n+k-1}{k}(-1)^k=\binom{n+k-1}{n-1}(-1)^k$
Hint: You might also be interested in an operator based approach.