Suppose you have a second order recurrence relation with constant coefficients defined as follows: \begin{cases} a_n = A a_{n-1} + B a_{n-2}, n = 2, 3, ...\\ a_0, a_1 \text{ are given initial conditions} \end{cases}
I want to use the generating function $f(x) = \sum_{n=0}^{\infty} a_n x^n$ to determine $a_n$.
So far I have $f(x) = \cfrac{(a_1 -A a_o)x + a_o}{1 - Ax - Bx^2}$, but I think I am not approaching this the right way.
Hint: expand the generating function in partial fractions. You'll want to consider two cases, depending on whether or not the denominator has distinct roots.