Find a closed form formula for $u_n$ where $u_{n+1} =2u_n - n^2$ and $u_0=a$
I'm not totally sure how closed form expressions are derived of a given sequence. I tried generating functions which goes like this: $\begin{aligned} \sum_{n=0}^{\infty} u_n x_0^n & =u_0+\sum_{n=0}^{\infty} u_{n+1} x^{n+1} \\ & =a+\sum_{n=0}^{\infty}\left(2 u_n-n^2\right) x^{n+1} \\ & =a+2 \sum_{n=0}^{\infty} u_n x^{n+1}-\sum_{n=0}^{\infty} n^2 x^{n+1} \\ & =a+2 x \cdot \sum_{n=0}^{\infty} u_n x^n-\sum_{n=0}^{\infty} n^2 x^{n+1} \end{aligned}$ Im stuck here. Please help.