I recently tried showing someone else how to solve a difference equation using z-transforms, but it's been a long time and what I was getting didn't look right. I was trying to solve the recurrence we all know and love
$x[n]=x[n-1]+x[n-2],x[0]=0,x[1]=1$
using the one-sided z-transform
$X(z)=\sum\limits_{n=0}^\infty x[n]z^{-n}$
So, taking the z-transform of both sides, I got
$X(z)=\sum\limits_{n=0}^\infty x[n-1]z^{-n}+\sum\limits_{n=0}^\infty x[n-2]z^{-n}=$
$z^{-1}\sum_{n=0}^\infty x[n-1]z^{-n+1}+z^{-2}\sum\limits_{n=0}^\infty x[n-2]z^{-n+2}$
I substitute $i=n+1$ in the first sum, $i=n+2$ in the second
$X(z)=z^{-1}\sum\limits_{i=1}^\infty x[i]z^{-i}+z^{-2}\sum\limits_{i=2}^\infty x[i]z^{-i}=$
$z^{-1}(X(z)-x[0]z^0)+z^{-2}(X(z)-x[0]z^0-x[1]z^{-1})=$
$z^{-1}X(z)+z^{-2}X(z)-z^{-3}$
$X(z)(1-z^{-1}-z^{-2})=-z^{-3}$
$X(z)=-\frac{z^{-3}}{1-z^{-1}-z^{-2}}$
Did I go wrong somewhere? If not, how do I proceed from here?
Update: All right, now that the mistake has been pointed out, let's see if I can correct it and continue. So the last correct step was
$X(z)=z^{-1}\sum\limits_{n=0}^\infty x[n-1]z^{-n+1}+z^{-2}\sum\limits_{n=0}^\infty x[n-2]z^{-n+2}$
Now the substitution here should be $i=n-1$ for the first sum and $i=n-2$ for the second yielding
$X(z)=z^{-1}\sum\limits_{i=-1}^\infty x[i]z^{-i}+z^{-2}\sum\limits_{i=-2}^\infty x[i]z^{-i}=$
$z^{-1}(x[-1]z+X(z))+z^{-2}(x[-2]z^2+x[-1]z+X(z))$
So if I were to continue like this, I'd have to calculate $x[-2]$ and $x[-1]$. I'm guessing this is why it was suggested to rewrite it as $x[n+2]=x[n+1]+x[n]$. In any case, I'm satisfied I can handle it.