Solving Recurrences using generating functions (inconsistency with characteristic equation)

31 Views Asked by At

So, I wanted to solve recurrence relation $a_n = 4a_{n-1} - 4a_{n-2}$ for $n \geq 2$ $a_0 = 6$ and $a_1 = 8$ using generating functions but I am getting it wrong. I am getting $a_n = (3 + 3n)2^n$ while the solution using characteristic equation is $a_n = (6 - 2n)2^n$. What am I doing wrong? Can someone please correct me?

Let $A(x) = \sum_{n=0}^{\infty} a_nx^n$ be the generating function for the sequence $\{a_n\}$.

Multiplying both sides of the recurrence relation by $x^n$ and summing over all $n \geq 2$

$$\sum_{n=2}^{\infty} a_nx^n = 4\sum_{n=2}^{\infty} a_{n-1}x^n - 4\sum_{n=2}^{\infty} a_{n-2}x^n$$

$$= A(x) - a_0 - a_1x = 4x(A(x) - a_0) - 4x^2A(x)$$

Working out conditions $a_0 = 6$ and $a_1 = 8$, we get:

$$A(x) - 6 - 8x = 4x(A(x) - 6) - 4x^2A(x)$$

Solving for $A(x)$,

$$A(x) = \frac{6-2x}{1-4x+4x^2}$$

Expanding this using partial fractions,

$$A(x) = \frac{3}{1-2x} + \frac{3}{(1-2x)^2}$$

Then the solution becomes, $$a_n = 3\cdot2^n + 3n\cdot2^n$$