how to solve a non homogenous difference equation

49 Views Asked by At

I'm trying to set up a guide I can use on my exams, for how to solve a non homogenous difference equation. Problem is my book doesn't really show how to do it. Theres just one example and it says we "set" the value for A and B without explaining how.

How do I find the values?

link to problem

1

There are 1 best solutions below

4
On BEST ANSWER

It is a non-homogenous recurrence $$ f(n) = -\frac{1}{2}f(n-1) + (n-1) \tag{1}$$ with associated homogeneous recurrence $$ g(n) = -\frac{1}{2}g(n-1) \tag{2} $$ The general solution to $(2)$ is $$g(n)=C(-\frac{1}{2})^n \tag{3}$$ for constant $C$.

To construct a general solution to $(1)$, we guess a particular solution, call it $p(n)$. Assume $p(n)$ has the same form as the non-homogeneous part of $(1)$, i.e. a polynomial in $n$ of degree one: $$ p(n) = an+b $$

Then

$$ an+b = -\frac{1}{2}(a(n-1)+b)+(n-1) $$ Equating the coefficients on the linear and constant term we find $a=2/3$ and $b=-4/9$, so $$ p(n) = \frac{2}{3}n-\frac{4}{9} $$

Thus, the general solution to $(1)$ will have the form

$$ \begin{aligned} f(n) & = g(n) + p(n) \\ & = C(-\frac{1}{2})^n +\frac{2}{3}n-\frac{4}{9} \end{aligned} $$

In order to guarantee $f(0)=1$ you have to set $C=13/9$.