Solving inhomogeneous second-order linear difference equation

72 Views Asked by At

In general, how does one solve an inhomogeneous second-order linear difference equation of the form

$$ a f(n+1) + b f(n) + c f(n-1) = d(n) $$

where $a, b, c$ are constants but $d(n)$ may also depend on $n$? For instance, consider as in here: $ 2 f(n+1) - 7 f(n) + 3 f(n-1) = 2 + 2^n $ with boundary conditions $q_0 = 1$ and $q_1 = 2$.

I understand that the general solution can be written as the sum of a particular solution to the inhomogeneous equation plus the general solution of the corresponding homogeneous equation, and I am able to find the latter, but how does one come up with a particular solution to the inhomogeneous equation in this case?