<s>[INST] Solve $a_n=7a_{n-1}-12a_{n-2}+3^n$ $a_0=1\:a_1=2$
Using generating functions I get:
$f\left(x\right)-1-2x=7xf\left(x\right)-7x-12x^2f\left(x\right)+\frac{1}{1+3x}-1-3x$
$f\left(x\right)=\frac{3}{14\left(1+3x\right)}-\frac{13}{2\left(3x-1\right)}\:+\:\frac{40}{7\left(4x-1\right)}$
Now how can I express $a_n$ from this?
 [/INST] Hint. One may just recall that
$$
\frac{1}{1-u}=\sum_{n=0}^\infty u^n,\qquad |u|<1,
$$ then applying it to 
$$
f\left(x\right)=\frac{3}{14\left(1+3x\right)}+\frac{13}{2\left(1-3x\right)}\:-\:\frac{40}{7\left(1-4x\right)}
$$ respectively with $u$ equals to $-3x$, $3x$ and $4x$.
Can you finish it?
</s>