# zizi's question at Yahoo! Answers regarding an inhomogeneous linear difference equation

#### MarkFL

Staff member
Here is the question:

Recurrence relation math/question?

Hi

Please check my attempt at solving the problem:

http://oi39.tinypic.com/2cfwfm1.jpg

Would appreciate any help with the questions I have written in red, thanks
I have posted a link there to this thread so the OP can view my work.

#### MarkFL

Staff member
Hello zizi,

We are given the linear difference equation:

$$\displaystyle u_{n}=6u_{n-1}-25u_{n-2}+\frac{32}{9}3^n$$ where $$\displaystyle u_0=6,\,u_1=46$$

and we are told to define $$\displaystyle A=\sin^{-1}\left(\frac{4}{5} \right)$$ and we are allowed to express the solution in terms of $A$.

We first want to solve the associated homogeneous equation:

$$\displaystyle u_{n}-6u_{n-1}+25u_{n-2}=0$$

The characteristic equation is:

$$\displaystyle r^2-6r+25=0$$

Application of the quadratic formula yields the characteristic roots:

$$\displaystyle r=3\pm4i$$

Expressing the roots in polar form, we find:

$$\displaystyle r=5e^{\pm Ai}$$

And so the homogenous solution is given by:

$$\displaystyle h_n=c_15^n\cos(nA)+c_25^n\sin(nA)$$

Now, we may assume there is a particular solution of the form:

$$\displaystyle p_n=c_33^n$$

We may substitute this solution into the difference equation to determine the value of the parameter $c_3$:

$$\displaystyle c_33^n-6c_33^{n-1}+25c_33^{n-2}=\frac{32}{9}3^n$$

Multiply through by 9 and factor the left side:

$$\displaystyle c_3\left(9\cdot3^n-18\cdot3^{n}+25\cdot3^{n} \right)=32\cdot3^n$$

Divide through by $3^n$:

$$\displaystyle c_3\left(9-18+25 \right)=32$$

$$\displaystyle 16c_3=32$$

$$\displaystyle c_3=2$$

And so we find the particular solution is:

$$\displaystyle p_n=2\cdot3^n$$

Thus, by superposition, we find the general solution to the difference equation is given by:

$$\displaystyle u_n=h_n+p_n=c_15^n\cos(nA)+c_25^n\sin(nA)+2\cdot3^n=5^n\left(c_1\cos(nA)+c_2\sin(nA) \right)+2\cdot3^n$$

Now we may use the initial values to determine the values of the two parameters.

$$\displaystyle u_0=5^0\left(c_1\cos(0\cdot A)+c_2\sin(0\cdot A) \right)+2\cdot3^0=c_1+2=6\implies c_1=4$$

$$\displaystyle u_1=5^1\left(c_1\cos(A)+c_2\sin(A) \right)+2\cdot3^1=3c_1+4c_2+6=46\implies c_2=7$$

Hence, the solution satisfying all given conditions is:

$$\displaystyle u_n=5^n\left(4\cos(nA)+7\sin(nA) \right)+2\cdot3^n$$