To get the time-domain response I am supposed to compute the inverse Z transform via the residue theorem, and here I run into a little problem: if I run y(z) through the algorithm as it is, I get the time-domain response:

[tex]y(t) = -\frac{1}{2} + \frac{1}{2}3^t[/tex]

which is indeed the correct system response except for the point t=0, where y(t)=0 but the correct value should be 1 (this can be seen by multiplying X0 with C - a MATLAB simulation also agrees).

What's funnier is that if I just rearrange y(z) a bit:

[tex]y(z) = 1 + \frac{z}{(z-1)(z-3)}[/tex]

and compute the inverse Z transforms for the two terms separately, I get:

[tex]y(t) = \delta(t) -\frac{1}{2} + \frac{1}{2}3^t[/tex]

which is the "real" correct response.

I'm obviously doing something wrong since the result of a calculation really should not depend on the form of the terms... Can anyone help? :)