<s>[INST] Generating function for $a_n= a_{n-1}+2a_{n-2}$+3 How do I find a generating function for $a_n= a_{n-1}+2a_{n-2}$+3 using sigma notation? with initial conditions $a_0$ =2 and $a_1$ = 2.
I'm mainly confused by how to deal with the "+3" at the end. Thanks!
What I've done so far is:
$\sum\limits_{n=0}^\infty a_n x^n = 2 + 2x+ \sum\limits_{n=2}^\infty (a_{n-1}+2a_{n-2} +3)x^n $
$\sum\limits_{n=2}^\infty (a_{n-1}+2a_{n-2} +3)x^n $ = $x\sum\limits_{n=1}^\infty a_{n-1}x^n$ +$2x^2 \sum\limits_{n=0}^\infty a_{n-2} x^n $ + $\frac{3}{(1-x)}$ 
 [/INST] Let $f(z) = \sum\limits_{n=0}^\infty a_n z^n$. Multiply the defining recurrence relation
$$a_n = a_{n-1} + 2 a_{n-2} + 3,\quad n \ge 2$$
by $z^n$ and start summing from $n = 2$, you get
$$
\underbrace{f(z) - \overbrace{(2 + 2 z)}^{a_0 + a_1 z}}_{
\sum\limits_{n=2}^\infty a_n z^n = f(z) - a_0 - a_1 z}
= 
\underbrace{z(f(z)-\overbrace{2}^{a_0})}_{
\sum\limits_{n=2}^\infty a_{n-1}z^n = z\sum\limits_{n=1}^\infty a_n z^n}
+
\underbrace{2z^2 f(z)}_{2\sum\limits_{n=2}^\infty a_{n-2}z^n = 2z^2\sum\limits_{n=0}^\infty a_n z^n}
+ \overbrace{\frac{3z^2}{1-z}}^{3\sum\limits_{n=2}^\infty z^n}$$
Please note that there is no need of special treatment for the extra term $3$.
As long as you know how to compute the sum $\sum_{n=2}^\infty 3 z^n$, you are fine. 
Finally, rearranging above expression gives you
$$f(z) = \frac{2-2z + 3z^2}{(1-z)(1 - z - 2z^2)}$$
and that's it.
</s>