How do you obtain the generating function from a summation?

61 Views Asked by At

I have a solved exercise where in one step, they try to get the generating function of a summation (which has previously been obtained from a recurrence relation:$a_{n+1}-a_{n}= 3^n$, where $a_0 = 1$)and this happens:

$\sum_{i=1}^\infty x^n3^n= \frac{x}{1-3x}$

They obtined it by:
1)Multiplying every term on the recurrence relation by $x^n$
2)Representing everything as various sumations $\sum_{i=1}^\infty x^na_{n}=\sum_{i=1}^\infty x^n3^n+\sum_{i=1}^\infty x^nn_{a-1}$

How do you obtain the generating function of a summation? Because I know that $\sum_{i=0}^\infty x^n= \frac{1}{1-x}$ but i don't know how to obtain $\sum_{i=1}^n x^n3^n= \frac{x}{1-3x}$ from $\sum_{i=0}^\infty x^n= \frac{1}{1-x}$. I must emphasize that I know that $\sum_{i=0}^\infty x^n= \frac{1}{1-x}$ but I do not understand why nor how anything derived from it works. If I were presented with any summation different to the ones whose generating functions I know by hard, I would have nothing (that I know of) to do.