1. ## 2nd-order difference equation

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

$a_0 = 3 , a_1 = -1$

any help on this is appreciated, thanks!

2. $
a_{n+2} - a_{n+1} - 2 a_n = 3(-1)^n$

Since $
a_{0} = 3$
, $
a_{1} = -1$

put n=0,we have
$a_{2}-a_{1}-2 a_{0} = 3(-1)^0$
$a_{2}-(-1)-2(3) = 3(1)$
therefore $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 $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 $x^2-x-2=0$, factoring to get $(x+1)(x-2)$

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

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

4. Hello, jef3189!

Solve the difference equation:

. . $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: . $\begin{Bmatrix}a_0 &=& 3 \\ a_1 &=& \text{-}1 \\ a_2 &=& 8 \\ & \vdots \end{Bmatrix}$

$\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: . $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: $X^n \,=\,a_n$

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

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

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

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

Use the first three terms of the sequence:

. . $\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: . $A =2,\;B=1,\;C=1$

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

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

then we have

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

Take 1st difference ,

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

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

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

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

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