<s>[INST] Z transform of a polynomial signal $$x(k)=\begin{cases} k^n \qquad k\ge 0 \\ 0 \ \  \qquad k<0 \end{cases}$$
I have this formula to calculate the Z transform:
$$\mathscr{Z} \{x(k) \}=\Big(-z \ \frac{d}{dz}\Big)^n \Big[ \frac{z}{z-1} \Big]$$

I have considered this particular case: $$x(k)=\begin{cases} k^2 \qquad k\ge 0 \\ 0 \ \  \qquad k<0 \end{cases}$$

$$f(z)=\frac{z}{z-1}$$
$$f'(z)=\frac{-1}{(z-1)^2}$$
$$-z f'(z)=\frac{z}{(z-1)^2}$$

$$g(z)=\frac{z}{(z-1)^2}$$
$$g'(z)=\frac{(z-1)^2-2z(z-1)}{(z-1)^4}=\frac{-z-1}{(z-1)^3}$$
$$-z g'(z)=\frac{z^2+z}{(z-1)^3}$$

So $$\mathscr{Z} \{ x(t) \}=\frac{z (z+1)}{(z-1)^3}$$

But, I have tried to calculate the inverse Z transform:
$$\mathscr{Z}^{-1} \Big\{\frac{z (z+1)}{(z-1)^3} \Big\}=\mathscr{Z}^{-1} \Big\{H(z) \Big\}$$

Partial fraction decomposition of $\frac{H(z)}{z}$:

$$\frac{z+1}{(z-1)^3}=\frac{1}{(z-1)^2}+\frac{2}{(z-1)^3}$$

$$\mathscr{Z}^{-1} \Big\{\frac{z}{(z-1)^2} \Big\}=k \ u(k)$$
$$\mathscr{Z}^{-1} \Big\{\frac{2z}{(z-1)^3} \Big\}=k^2 \ u(k)$$

$$\mathscr{Z}^{-1} \Big\{H(z) \Big\}=(k+k^2) \ u(k)$$

Where is the mistake?

I know this formula to calculate the inverse Z transform:
$$\mathscr{Z^{-1}}\Big[ \frac{C_{i,j} \ z}{(z-p_i)^j}\Big]=C_{i,j} \ \frac{k^{(j-1)}}{(j-1)!} \ p_i^{k-j+1} \ u(k)$$

Is it not applicable to $\frac{z(z+1)}{(z-1)^3}$? 

Thanks
 [/INST] Consider:
$$z(z+1) = z^{2} + z = (z^{2} - 2 z + 1) + 3(z-1) + 2$$
which leads to
\begin{align}
\frac{z(z+1)}{(z-1)^{3}} &= \frac{(z-1)^{2} + 3 \, (z-1) + 2}{(z-1)^{3}} \\
&= \frac{1}{z-1} + \frac{3}{(z-1)^{2}} + \frac{2}{(z-1)^{3}}.
\end{align}
Using
\begin{align}
\frac{1}{1-x} &= \sum_{k=0}^{\infty} x^{k} \\
\frac{1}{(1-x)^{2}} &= \sum_{k=0}^{\infty} (k+1) \, x^{k} \\
\frac{1}{(1-x)^{3}} &= \frac{1}{2} \, \sum_{k=0}^{\infty} (k+1)(k+2) \, x^{k}
\end{align}
provides
\begin{align}
\frac{z(z+1)}{(z-1)^{3}} &= \sum_{k=0}^{\infty} \left[ 1 - 3 \, (k+1) + 2 \, \frac{(k+1)(k+2)}{2} \right] \, z^{-k} \\
&\Doteq \left[ 1 - 3 \, (k+1) + (k^{2} + 3 k + 2) \right] \\
&\Doteq k^2.
\end{align}
</s>