0

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 Answers1

0

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$.

  • Im starting to understand it better, but how did you get + from n? – mangekyou Nov 08 '19 at 02:54
  • Choose $p(n)$ to have a similar form as the inhomogenous part. $n$ is a linear function, so choose $p(n)$ to be a linear function of the form $an+b$. –  Nov 08 '19 at 20:17
  • I see. Thank you so much! – mangekyou Nov 08 '19 at 23:18
  • If p(n) were a second degree polunomial, ie n^2, would I choose an^2+bn+c? Is there a table I can check what I chose for different p(n) values? – mangekyou Nov 09 '19 at 13:34