I have a class exercise of an inverse Z transform and I have some trouble. I will render an example to make my point. Let's asume the Z transform pairs: $$a^n \cdot u[n] \Leftrightarrow \frac{1}{1-az^{-1}} \qquad\qquad x[n-k] \Leftrightarrow z^{-k}X(z) \qquad\qquad \delta[n] \Leftrightarrow 1 $$ Given the following function, we want its inverse Z transform: $$H(z) = \frac{p_0p_1z^{-2}}{(1-p_0z^{-1})(1-p_1z^{-1}) } $$
First Method
Simple fraction expansion:
$$H(z) = z^{-2}\left( \frac{\dfrac{p_0^2p_1}{p_0-p_1}}{1-p_0z^{-1}} + \frac{\dfrac{p_0p_1^2}{p_1-p_0}}{1-p_1z^{-1}} \right)$$
Applying the properties:
$$ \begin{aligned} h[n] &= \frac{p_0^2p_1}{p_0-p_1} p_0^{n-2} \cdot u[n-2] + \frac{p_0p_1^2}{p_1-p_0} p_1^{n-2} \cdot u[n-2] \\ \\ h[n] &= \frac{p_1}{p_0-p_1} p_0^{n} \cdot u[n-2] + \frac{p_0}{p_1-p_0} p_1^{n} \cdot u[n-2] \end{aligned} $$
Second Method
Adding and subctracting 1:
$$ \begin{aligned} H(z) &= 1 + \frac{p_0p_1z^{-2}}{(1-p_0z^{-1})(1-p_1z^{-1})} -1 \\ &= 1 + \frac{(p_0+p_1)z^{-1}-1}{(1-p_0z^{-1})(1-p_1z^{-1})} \end{aligned} $$
Simple fraction expansion:
$$ \begin{aligned} H(z) &= 1 + \frac{\dfrac{p_1}{p_0-p_1}}{1-p_0z^{-1}} + \frac{\dfrac{p_0}{p_1-p_0}}{1-p_1z^{-1}} \\ \\ h[n] &= \delta[n] + \frac{p_1}{p_0-p_1} p_0^{n} \cdot u[n] + \frac{p_0}{p_1-p_0} p_1^{n} \cdot u[n] \end{aligned} $$
Conclusion
Both solutions are quite similar, they are the same in the interval [2,$\infty$) but different in the interval [0,2]. So, where is the error?
Thanks