Solve the recurrence relation $x_{n+2} -3x_{n+1} + 2 x_n = n$

150 Views Asked by At

Solve

$$x_{n+2} -3x_{n+1} + 2 x_n = n$$

when $x_0 = 1$ and $x_1 = 0$.

I started with the homogen solution: $$r^2 -3r +2 = 0$$

So $$x_n^h = A1^n + B2^n$$

I know that $x_n = x_n^p + x_n^h$

But I fail with the particulair solution $x_n^p$. I thought about guessing the polynom $Dn+E$, however this gives me $D + 2D - 3D = 1$ and that has no solution.

1

There are 1 best solutions below

0
On

Consider the generating function $f(t)=\sum_{n=0}^\infty x_n t^n$, which will satisfy: $$ \sum_{n=0}^\infty x_{n+2}t^n - \sum_{n=0}^\infty 3x_{n+1} t^n + \sum_{n=0}^\infty 2x_nt^n = \sum_{n=0}^\infty n t^n $$ The RHS is simply $\frac{t}{(1-t)^2}$. The LHS, however, is $$ t^{-2}(f(t)-x_1t-x_0) - 3t^{-1}(f(t)-x_0)+2f(t) $$

Putting everything together, $$ t^{-2} (f(t)-1)-3t^{-1}(f(t)-1)+2f(t)=\frac{t}{(1-t)^2} $$ $$\implies (2t-1)(t-1)f(t)=\frac{t^3}{(1-t)^2}-(3t-1) $$

Finally, $$ f(t) = - \left[ \frac{3t-1}{(2t-1)(t-1)} + \frac{t^3}{(1-t)^3}\right] = -\left[-\frac{1}{2t-1}+\frac{2}{t-1}+ \frac{t^3}{(1-t)^3}\right]$$

This last expression should easily admit its Taylor series representation by application of the infinite geometric series formula; the coefficients of $t^n$ are then your solutions $x_n$ by construction.