i was trying to solve this exercise with Z-Transform:
$ \begin{cases} x(n+2)-x(n+1)=a(n) & n\ge0 \\ x(0)=x(1)=0 \end{cases} $
where:
$ a(n)=\begin{cases} n^2-n & n & even \\ n^2+n & n & odd \end{cases} $
I usually solve them using the geometric series of $ w $, that converges in $\frac{1}{1-w} $ , but i can't manage to solve it.
We have
$$a[n] = \left(n^2 - (-1)^{n}n\right)u[n]\text{*}$$ and the property $$\mathcal{Z}\left(x[n+k]\right)(z) = z^{k}\cdot\mathcal{Z}\left(x[n]\right)(z) -\sum \limits_{i=0}^{k-1}z^{k-i}x[i].$$
Hence,
$$\mathcal{Z}\left(x[n+2] - x[n+1]\right)(z) = \mathcal{Z}\left(a[n]\right)(z) $$$$\implies z^2 \mathcal{Z}\left(x[n]\right)(z) -z^2x[0] -zx[1] -z \mathcal{Z}\left(x[n]\right)(z) +zx[0] = \mathcal{Z}\left(n^2u[n]\right)(z) - \mathcal{Z}\left((-1)^nnu[n]\right)(z) $$$$\implies (z^2-z) \mathcal{Z}\left(x[n]\right)(z) = \frac{z^{-1}(1+z^{-1})}{(1-z^{-1})^3} + \frac{z^{-1}}{(1+z^{-1})^2}, |z| > 1 $$$$\implies \mathcal{Z}\left(x[n]\right)(z) = \frac{2z(z^2+3)}{(z-1)^4(z+1)^2}, |z| > 1.$$ You can solve this by using partial fraction method and a table of $Z$- Transform pairs.
*$u[n]$ is the step function.