Solve the second-order difference equation
y[k+2]-5 y[k+1]+6 y[k]=0 y[0]=0 y[1]=2
Taking the z transform of both sides of the equation and using the properties of linearity we have
\mathcal{Z}\{y[k+2]\}-5 \mathcal{Z}\{y[k+1]\}+6 \mathcal{Z}\{y[k]\}=0From the first shift theorem we have
z^2 Y(z)-z^2 y[0]-z y[1]-5(z Y(z)-z y[0])+6 Y(z)=0where
Y(z)=\mathcal{Z}\{y[k]\}Substituting values for the conditions gives
\begin{aligned} z^2 Y(z)-0 z^2-2 z-5(z Y(z)-0 z)+6 Y(z) & =0 \\ z^2 Y(z)-5 z Y(z)+6 Y(z) & =2 z \end{aligned}Hence
\left(z^2-5 z+6\right) Y(z)=2 zso that
Y(z)=\mathcal{Z}\{y[k]\}=\frac{2 z}{(z-2)(z-3)}Dividing both sides by z gives
\frac{Y(z)}{z}=\frac{2}{(z-2)(z-3)}Expressing the r.h.s. in partial fractions yields
\begin{aligned} & \frac{Y(z)}{z}=\frac{2}{z-3}-\frac{2}{z-2} \\ & Y(z)=\frac{2 z}{z-3}-\frac{2 z}{z-2} \end{aligned}Inverting gives the solution to the difference equation:
y[k]=2\left(3^k\right)-2\left(2^k\right)