First solve the homogeneous recurrence relation by assuming a solution of the form :

.

Now get particular solutions to the non-homogeneous recurrence relations:

1. : Try and solve for and .

2. : Note that is one of the homogeneous solutions. Therefore try and solve for k.

Now add these two particular solutions to the homogeneous solution to get the general solution.