# Using generating function to solve initial value problems

I have a hard exam coming up and something I've struggled with since week 1 of semester is initial value problems. How would I go about solving:

(a) $u_{n} - 7u_{n-1} = 3 * 7^n : u_0 = 4$

(b) $u_{n} - 4u_{n-1} + 4u_{n-1} = 3*2^n : u_0 = 6/u_1 =1$

(c) $u_{n} - 3u_{n-1} = 2 * 5^n : u_0 = 7$

Any help is appreciated.

$$f_{n} - a f_{n-1} = b \, c^{n}.$$ Since the generating function method is being asked then that is what will be demonstrated next.
\begin{align} \sum_{n=0}^{\infty} \left( f_{n+1} - a f_{n} \right) t^{n} &= \frac{b}{1-c t} \\ \sum_{n=1}^{\infty} f_{n} t^{n-1} - a F(t) &= \\ \frac{1}{t} \, \left( F(t) - f_{0} \right) - a F(t) &= \\ (1 - a t) F(t) &= f_{0} + \frac{b}{1- c t} \end{align} which gives $$F(t) = \sum_{n=0}^{\infty} f_{n} \, t^{n} = \frac{f_{0}}{1 - a \, t} + \frac{b}{(1 - a \, t)(1 - c \, t)}.$$ Now: $$\frac{1}{(1 - a \, t)(1 - c \, t)} = \frac{1}{a - c} \, \left( \frac{a}{1 - a \, t} - \frac{c}{1 - c \, t} \right)$$ which leads to \begin{align} \sum_{n=0}^{\infty} f_{n} \, t^{n} &= \left( f_{0} + \frac{a b}{a-c} \right) \, \frac{1}{1 - a\, t} - \frac{b c}{a-c} \, \frac{1}{1 - b \, t} \\ &= \sum_{n=0}^{\infty} \left[ \left( f_{0} + \frac{a b}{a - c} \right) \, a^{n} - \frac{b c}{a-c} \, b^{n} \right] \, t^{n}. \end{align} This yields $$f_{n} = \left( f_{0} + \frac{a b}{a - c} \right) \, a^{n} - \frac{b c}{a-c} \, b^{n}.$$