I believe that the term "inhomogeneous difference equation" describes the following problem:

$\displaystyle a_{n + 2} - 2a_{n + 1} + a_n = 4$ with the conditions $\displaystyle a_0 = 1$ and $\displaystyle a_1 = 2$. (This problem has no relevance to anything, I just made it up.)

====================================

TPH gave a method of solution for this.

The homogeneous version of this difference equation is

$\displaystyle a_{n + 2} - 2a_{n + 1} + a_n = 0$

and has the characteristic equation

$\displaystyle m^2 - 2m + 1 = 0$

$\displaystyle (m - 1)^2 = 0$

So m = 1 is a double root. Thus

$\displaystyle a_n = A(1)^2 + Bn(1)^2 = Bn + A$

as the homogeneous solution.

We need a particular solution. So let $\displaystyle a_n = C$. Then $\displaystyle a_{n + 2} = C$, $\displaystyle a_{n + 1} = C$ and substitution into the original equation gives:

$\displaystyle C - 2C + C = 4$

which is impossible.

====================================

Soroban also gave a method. Consider the related difference equation:

$\displaystyle a_{n + 3} - 2a_{n + 2} + a_{n + 1} = 4$

When we subtract the original equation

$\displaystyle a_{n + 2} - 2a_{n + 1} + a_n = 4$

from this we get the homogeneous difference equation:

$\displaystyle a_{n + 3} - 3a_{n + 2} + 3a_{n + 1} - a_n = 0$

The characteristic equation here is

$\displaystyle m^3 - 3m^3 + 3m - 1 = 0$

$\displaystyle (m - 1)^3 = 0$

and has m = 1 as a triple root. So the solution of the homogeneous equation is

$\displaystyle a_n = A(1)^n + Bn(1)^n + Cn^2(1)^n = Cn^2 + Bn + A$

Now we substitute this solution into the original equation:

$\displaystyle a_{n + 2} - 2a_{n + 1} + a_n = 4$

$\displaystyle [C(n + 2)^2 + B(n + 2) + A] - 2[C(n + 1)^2 + B(n + 1) + A] + [Cn^2 + Bn + A] = 4$

After a number of cancellations:

$\displaystyle 2C = 4$

So $\displaystyle C = 2$.

Thus

$\displaystyle a_n = 2n^2 + Bn + A$

Application of the conditions $\displaystyle a_0 = 1$ and $\displaystyle a_1 = 2$ gives (respectively)

$\displaystyle a_0 = A = 1$ ==> $\displaystyle a_n = 2n^2 + Bn + 1$

and

$\displaystyle a_1 = 2(1)^2 + B(1) + 1 = 2$

$\displaystyle 2 + B + 1 = 2$

$\displaystyle B + 3 = 2$

$\displaystyle B = -1$

Which implies

$\displaystyle a_n = 2n^2 - n + 1$ <-- This correctly defines the solution.

====================================

My question (long in coming) is why don't both of these methods work? Is there an assumption in TPH's method that makes it unviable for this specific problem? And, if so, is Soroban's the most general method?

-Dan