I'm doing multiple generating functions and I seem to be messing up on my partial derivatives at the moment.
This is my problem:
finding an explicit formula for $a_n$ if $a_0=1$, $a_1=4$, and $a_{n+2}=8a_{n+1} -16a_n$.
I know I should obtain $$a_n=-\frac13\left(4^n-4^{n+1}\right)\;,$$ but my partial derivative somehow wound up being $$a_n=\frac13\left(4^n-4^{n+1}\right)\;,$$ which is very frustrating. any clarification of my mistake would be much appreciated. Take in mind I am using generating functions to solve this problem.
Neither formula is correct.
I would first rewrite the recurrence as $a_n=8a_{n-1}-16a_{n-2}$. I make the assumption that $a_n=0$ for $n<0$, so to make the recurrence valid for $n=0$ and $n=1$ I have to adjust it slightly:
$$a_n=8a_{n-1}-16a_{n-2}+[n=0]-4[n=1]\;,\tag{1}$$
where the square brackets are Iverson brackets. I then multiply $(1)$ by $x^n$ and sum over $n\ge 0$ to get the generating function $g(x)$ on the lefthand side:
$$\begin{align*} g(x)&=\sum_{n\ge 0}a_nx^n=8\sum_{n\ge 0}a_{n-1}x^n-16\sum_{n\ge 0}a_{n-2}x^n+1-4x\\\\ &=8xg(x)-16x^2g(x)+1-4x\;. \end{align*}$$
Solving for $g(x)$ yields
$$g(x)=\frac{1-4x}{1-8x+16x^2}=\frac{1-4x}{(1-4x)^2}=\frac1{1-4x}=\sum_{n\ge 0}4^nx^n\;,$$
so that $a_n=4^n$. And you can check that this is correct: it gives the correct values for $a_0$ and $a_1$, and it satisfies the recurrence, since
$$8\cdot 4^{n+1}-16\cdot4^n=(32-16)4^n=16\cdot4^n=4^{n+2}\;.$$