Generating function given the recurrence relation

generating-functionsrecurrence-relations

Let the recurrence relation be given by $$a_{n}=2a_{n-1}+3$$ and let $a_0=1$ find the generating function in closed form. $$\text{Attempt}$$ the general equation of the form $a_n=ca_{n-1}+d$ has the solution as $a_n=c^n(a_0+\frac{d}{c-1})-\frac{d}{c-1}$ thus the relation for th above recurrence relation is $a_n=4(2^n)-3$ . However I dont know how to handle that constant 3 hence I cant proceed to get the generating function.Any help would be appreciated!

Best Answer

The generating function is $$F(x) = \sum_{n\ge0}a_nx^n = 1 + x\sum_{n\ge0}(2a_n + 3)x^n = 1 + 2xF(x) + \frac{3x}{1-x}\ .$$ Thus, $$F(x) = \frac{1 + \frac{3x}{1-x}}{1 - 2x} = \frac{1 + 2x}{(1-x)(1-2x)}\ .$$