# Thread: Finding Function for a recurrance relation

1. ## Finding Function for a recurrance relation

I need help find a function for the following recurrence relation

h$\displaystyle _{n}$=2*h$\displaystyle _{n-1}$+2*h$\displaystyle _{n-2}$

It's getting to big and messy for me to recognize any pattern.

2. I am assuming you have some initial condtions?. Something like

$\displaystyle h_{n}=0, \;\ h_{1}=1$ or something like that.

You can write it as $\displaystyle h^{2}-2h-2=0$

Solving, we see $\displaystyle h=\sqrt{3}+1, \;\ h=1-\sqrt{3}$

Then, $\displaystyle h_{n}=a(\sqrt{3}+1)^{n}+b(1-\sqrt{3})^{n}$

Now apply your initial condtions to find a and b.

3. h$\displaystyle _{1}$=3
h$\displaystyle _{2}$=8

4. In that event, you have two equations to solve for a and b. Just use your conditions.

$\displaystyle a(\sqrt{3}+1)+b(1-\sqrt{3})=3$

$\displaystyle a(\sqrt{3}+1)^{2}+b(1-\sqrt{3})^{2}=8$

5. Originally Posted by hockey777
I need help find a function for the following recurrence relation

h$\displaystyle _{n}$=2*h$\displaystyle _{n-1}$+2*h$\displaystyle _{n-2}$

It's getting to big and messy for me to recognize any pattern.
This is a linear constant coefficient homogeneous difference equation. You treat it like a linear constant coefficient homogeneous ODE.

Take trial solution $\displaystyle h_n=\mu^n$, substitute this into the recurrence to get a quadratic equation for $\displaystyle \mu$. Solve the quadratic to get two basic solutions, form a general solution as a linear combination of these two solutions.

RonL