2nd order recurrence relation with constant coefficients

105 Views Asked by At

I need to find the general solution to the following second order linear recurrence relation:

an=an-1+2an-2-2n+1 for n≥2

I am looking for the auxiliary equation to do so and so far have t2=t+2 but I'm not sure what to do about the -2n+1 part.

2

There are 2 best solutions below

0
On

Try to find a particular solution of the form $$ An^2+Bn+C $$ and add it to the solution of the homogeneous part.

0
On

First you solve homogeneous equation: $$a_n=a_{n-1}+2a_{n-2}$$ By letting $a_n=x^n$ you will get: $$x^n=x^{n-1}+2x^{n-2} \Rightarrow x=-1;2.$$ So the particular solution is: $$a_n=C_1(-1)^n+C_2\cdot 2^n.$$ General solution you will search in the form: $$a_n=C_1(-1)^n+C_2\cdot 2^n+An+B.$$ When you plug this into the initial nonhomogeneous equation, you will get: $$An+B=A(n-1)+B+2(A(n-2)+B)-2n+1 \Rightarrow A=1; \ \ B=2.$$ Hence the general solution is: $$a_n=C_1(-1)^n+C_2\cdot 2^n+n+2.$$ You can find $C_1$ and $C_2$ if $a_0$ and $a_1$ are given.