How to solve a 2nd order non-homogeneous linear recurrence?

4.4k Views Asked by At

I have a problem in solving this equation :

$x_{n+2} + 3\ x_{n+1} + 2\ x_{n} = 5 \times 3^n $

given that $x_{0} = 0$ and $x_{1} = 1$.

I solved the homogeneous associated equation and got $v_{n} = c_{1} \times (-1)^{n} + c_{2} \times (-2)^{n}$ (where $c_{1}$ and $c_{2}$ are constants). Could somebody explain the general method for solving second order non-homogeneous linear recurrence ?

2

There are 2 best solutions below

0
On BEST ANSWER

Well, you need to find a particular solution of the inhomogeneous equation, and the rhs suggest that something of the form $c(n)3^n$ should work. The simplest form of $c$ is a constant, so try that. If it works, you are golden, if not, try a linear function, etc, then add the homogeneous solution and you are good.

2
On

I have just found the solution. This is not general method, but some piece of heuristics. May be it somehow will help you to find some solutions in simple cases. I use method of undetermined coeficients. I guess, that should be $$x_n=c3^n+d(-1)^n,$$ for some real constants $c,d$. Now, calculation of $c,d$ is very simple. We have also $$x_{n+1}=3c3^n-d(-1)^n$$ $$x_{n+2}=9c3^n+d(-1)^n,$$ so: $$x_{n+2}+3x_{n+1}+2x_n=9c3^n+d(-1)^n+ 9c3^n-3d(-1)^n+2c3^n+2d(-1)^n=20c3^{n}$$ From the recurrence must be: $$20c3^{n}=5.3^n,$$ so: $c=\frac{1}{4}$. Now we know, that $$\frac{3^n}{4}+d(-1)^n$$ satisfies your recurrence. And because $x_0=0$, we must have $d=-\frac14$. Therefore we have following result: $$x_n=\frac{3^n}{4}-\frac{(-1)^n}4.$$