Solution of Difference and Fredholm Equations
Author's Data: Housam Binous
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA
Email: binoushousam@yahoo.com

Acknowledgement :

These example was given by W. G. Kelley and A. C. Peterson, Difference Equations: An introduction with applications, 2sd edition, 2001, Academic Press.

Solution using ZTransform and its inverse.
We obtain: y[k] = 3 (2^k)-2 (3^k).

ZTransform[y[k + 2] - 5 y[k + 1] + 6 y[k] == 0, k, 
      z]

Solve[%, ZTransform[y[k], k, z]]

y[0] = 1; y[1] = 0;

InverseZTransform[((-5 z y[0] + (z^2) y[0] + z y[1])/(6 - 5 z + (z^2))), z, k]

The same solution is obtained using RSolve

y[0] =. ; y[1] =. ;

RSolve[{y[k + 2] - 5 y[k + 1] + 6 y[k] == 0, y[0] ==  1, 
        y[1] ==  0}, y[k], k]

Solution using ZTransform and its inverse.
We obtain: u[k]=sin((π/2) k) and v[k]=cos((π/2) k) .

ZTransform[{u[k + 1] - v[k] ==  0, u[k] + v[k + 1] == 0}, 
      k, z]

Solve[%, {ZTransform[u[k], k, z], ZTransform[v[k], k, z]}]

u[0] = 0; v[0] = 1;

InverseZTransform[{-((-(z^2) u[0] - z v[0])/(1 + 
                (z^2))), -((z u[0] - (z^2) v[0])/(1 + (z^2)))}, 
      z, k]

{(1/2) I ((((-I))^k) - (I^k)), 
          (1/2) ((((-I))^k) + (I^k))} -  {Sin[k Pi/2], Cos[k Pi/2]} // Simplify

The same solution is obtained using RSolve

u[0] =. ; v[0] =. ;

RSolve[{u[k + 1] - v[k] ==  0, u[k] + v[k + 1] == 0, 
        u[0] ==  0, v[0] ==  1}, {u[k], v[k]}, k]

Solution of a Fredholm summation equation using RSolve

sol = 
      Solve[Table[
          y[k] ==  10 + Sum[k m  y[m], {m, 0, 20}], {k, 0, 20}], 
        Table[y[k], {k, 0, 20}]]

ZTransform[y[k] ==  10 + Sum[k m  y[m], {m, 0, 20}], k, 
      z]

Solve[%, ZTransform[y[k], k, z]]

InverseZTransform[%, z, k] /. sol