1. ## 2nd-order difference equation

Solve the difference equation:
$\displaystyle a_{n+2} - a_{n+1} - 2 a_n = 3(-1)^n$

$\displaystyle a_0 = 3 , a_1 = -1$

any help on this is appreciated, thanks!

2. $\displaystyle a_{n+2} - a_{n+1} - 2 a_n = 3(-1)^n$
Since $\displaystyle a_{0} = 3$ ,$\displaystyle a_{1} = -1$
put n=0,we have
$\displaystyle a_{2}-a_{1}-2 a_{0} = 3(-1)^0$
$\displaystyle a_{2}-(-1)-2(3) = 3(1)$
therefore $\displaystyle a_2$=3+6-1=8

3. Since ,
put n=0,we have

therefore =3+6-1=8
I understand what you've written, but maybe I should have specified that by "a solution" I'm talking about function such that $\displaystyle f(n) = a_n$

I believe you start by finding a characteristic polynomial for the homogeneous equation (or something like that)
which for this would be $\displaystyle x^2-x-2=0$, factoring to get $\displaystyle (x+1)(x-2)$

So the homogeneous is $\displaystyle A(-1)^n+B(2)^n$?

Then your supposed to find a particular solution of the form $\displaystyle C(-1)^n$ any help from here I'm stuck

4. Hello, jef3189!

Solve the difference equation:

. . $\displaystyle a_{n+2} \:=\: a_{n+1} + 2 a_n + 3(\text{-}1)^n \qquad a_0 = 3 ,\;\; a_1 = \text{-}1$

The first few terms are: .$\displaystyle \begin{Bmatrix}a_0 &=& 3 \\ a_1 &=& \text{-}1 \\ a_2 &=& 8 \\ & \vdots \end{Bmatrix}$

$\displaystyle \begin{array}{ccccc}\text{We are given:} & a_{n+2} &=& a_{n+1} + 2a_n + 3(\text{-}1)^n \\ \\[-3mm] \text{The next term:} & a_{n+3} &=& a_{n+2} + 2a_{n+1} - 3(\text{-}1)^n \end{array}$

Add: .$\displaystyle a_{n+3} + a_{n+2} \;=\; a_{n+2} + a_{n+1} + 2a_{n+1} + 2a_n \quad\Rightarrow\quad a_{n+3} - 3a_{n+1} - 2a_n \:=\:0$

Let: $\displaystyle X^n \,=\,a_n$

Substitute: .$\displaystyle X^{n+3} - 3X^{n+1} - 2X^n \:=\:0$

Divide by $\displaystyle X^n\!:\;\;X^3 - 3X - 2 \:=\:0$

Factor: . $\displaystyle (X+1)^2(X-2) \:=\:0 \quad\Rightarrow\quad X \:=\:\text{-}1,\:\text{-}1,\:2$

The function is of the form: .$\displaystyle f(n) \;=\;A(\text{-}1)^n + Bn(\text{-}1)^n + C(2^n)$

Use the first three terms of the sequence:

. . $\displaystyle \begin{array}{cccccccccc} f(0) \:=\:3 & A + C &=& 3 \\ f(1) \:=\:\text{-}1 & -A - B + 2C &=& \text{-}1 \\ f(2) \:=\:8 & A + 2B + 4C &=& 8 \end{array}$

Solve the system: .$\displaystyle A =2,\;B=1,\;C=1$

Therefore: .$\displaystyle f(n) \;=\;2(\text{-}1)^n + n(\text{-}1)^n + 2^n \;=\;\boxed{2^n + (\text{-}1)^n(n+2)}$

5. Let $\displaystyle a_n = (-1)^n b_n$

then we have

$\displaystyle b_{n+2} + b_{n+1} - 2b_n = 3$

Take 1st difference ,

$\displaystyle \delta (b_{n+2} + b_{n+1} - 2b_n) = \delta(3)$
$\displaystyle (b_{n+3} - b_{n+2}) + ( b_{n+2} - b_{n+1}) - 2( b_{n+1}- b_{n}) = 0$
$\displaystyle b_{n+3} - 3 b_{n+1} + 2 b_{n} = 0$
Now , calculate the characteristic roots :
$\displaystyle t^3 - 3t + 2 = 0$
$\displaystyle (t-1)^2 (t+2) = 0$
$\displaystyle t = 1 , t= - 2$

Be careful that $\displaystyle t=1$is the double root , we have

$\displaystyle b_n = A + Bn + C(-2)^n$

$\displaystyle a_n = A(-1)^n + B(-1)^n n + C(2)^n$

First obtain $\displaystyle a_2 = 10$ , then find $\displaystyle A,B,C$ by solving the system of linear equtions .