Solve the following recurrence using generating functions: $a_{n+2} = 3a_{n+1} - 2a_n, a_0 = 1, a_1 = 3$.
My partial solution:
We can rewrite $a_{n+2} = 3a_{n+1} - 2a_n$, as $a_{n+2} - 3a_{n+1} + 2a_n = 0$, and we let $A(z) = \sum a_n z^n$. The goal is to compute $A(z)$ as this can be done as follows: $$A(z) - a_0 - a_1z - 3z(A(z) - a_0) + 2z^2A(z) = 0$$ $$(1-3z+2z^2)A(z) = a_0 + a_1z -3a_0z$$ $$A(z) = \frac{a_0 + (a_1 - 3a_0)z}{1-3z+2z^2}$$ $$\quad \quad = \frac{a_0 + (a_1 - 3a_0)z}{(1-z)(1-2z)}$$ $$\quad \quad = \frac{C}{(1-z)}+\frac{D}{(1-2z)}$$
And, I don't know how to continue, I cannot figure out the remaining. I'm pretty sure it is obvious, but I just cannot see it. If someone can help me I would be glad.
Some hints.
To find $C$ and $D$, use that $a_0 = A(0)$ and $a_1 = A'(0)$. Two equations in two unknowns..
Once the above is done, use the following identity to get the formula for each $a_n$. $${1 \over 1 - x} = 1 + x + x^2 + x^3 + ....$$