Before your read my problem: i am thankful for every help i can get but i need a closed form (formal power series) and not any other representation of my function.
I am working on a problem involving generating functions. I derived a function for my counting problem of the form:
$$ f(x) = \frac{4x^2 + 4x}{1 - 3x - 3x^2}. $$
Now I want to find a closed formal power series for this function in the form:
$$ \sum_{n=0}^\infty a_n x^n. $$
First, I concluded that I had to use polynomial division because the degree of $P(x)/Q(x)$ are the same. After performing polynomial division, I found that:
$$ f(x) = -\frac{4}{3} + \frac{4}{3} \cdot \frac{1}{1 - 3x - 3x^2}. $$
Here, the constant $ -\frac{4}{3} $ and the $ \frac{4}{3}$ multiplied with the series have "no effect" on how I calculate the formal power series, as I can apply them later to the closed-form solution. So I consider:
$$ f(x) = -\frac{4}{3} + \frac{4}{3} \cdot \left( \sum_{n=0}^\infty a_n x^n \right). $$
To proceed, I want to find the decomposition of $ \frac{1}{1 - 3x - 3x^2} $. I start with partial fraction decomposition:
$$ \frac{1}{(x - x_1)(x - x_2)} = \frac{A}{x - x_1} + \frac{B}{x - x_2}, $$
where $ x_1 $ and $ x_2 $ are the roots of $ 1 - 3x - 3x^2 $, calculated as:
$$ x_1 = \frac{3 + \sqrt{21}}{-6}, \quad x_2 = \frac{3 - \sqrt{21}}{-6}. $$
From the decomposition, we write:
$$ 1 = A(x - x_2) + B(x - x_1), $$
which expands to:
$$ 1 = x(A + B) - Ax_2 - Bx_1. $$
By equating coefficients, we find:
$$ A + B = 0 \quad \text{so} \quad A = -B, $$
and:
$$ -Ax_2 - Bx_1 = 1 \quad \text{then plug in A = -B we get:} \quad B(x_2 - x_1) = 1. $$
Substituting the values of $ x_1 $ and $ x_2 $, we calculate:
$$ B = \sqrt{\frac{3}{7}}, \quad A = -\sqrt{\frac{3}{7}}. $$
Thus, the decomposition becomes:
$$ \frac{1}{(x - x_1)(x - x_2)} = \frac{-\sqrt{\frac{3}{7}}}{x - x_1} + \frac{\sqrt{\frac{3}{7}}}{x - x_2}. $$
Next, consider the term $ \frac{-\sqrt{\frac{3}{7}}}{x - x_1} $. This can be rewritten as:
$$ \frac{-\sqrt{\frac{3}{7}}}{x - x_1} = \frac{-\sqrt{\frac{3}{7}}}{-x_1 \left( 1 - \frac{x}{x_1} \right)} = \frac{\sqrt{\frac{3}{7}}}{x_1} \cdot \frac{1}{1 - \frac{x}{x_1}}, $$
which is:
$$ \frac{\sqrt{\frac{3}{7}}}{x_1} \cdot \sum_{n=0}^\infty \left( \frac{x}{x_1} \right)^n. $$
Similarly, for $ \frac{\sqrt{\frac{3}{7}}}{x - x_2} $, we have:
$$ \frac{\sqrt{\frac{3}{7}}}{x - x_2} = \frac{\sqrt{\frac{3}{7}}}{-x_2} \cdot \sum_{n=0}^\infty \left( \frac{x}{x_2} \right)^n. $$
Adding these terms together gives:
$$ g(x) = \frac{\sqrt{\frac{3}{7}}}{x_1} \cdot \sum_{n=0}^\infty \left( \frac{x}{x_1} \right)^n + \frac{\sqrt{\frac{3}{7}}}{-x_2} \cdot \sum_{n=0}^\infty \left( \frac{x}{x_2} \right)^n. $$
Substituting the values of $x_1$ and $x_2$ and simplifying, we get:
$$ g(x) = \frac{3}{14} \cdot (7 + \sqrt{21}) \cdot \sum_{n=0}^\infty \left( \frac{x}{6(-3 + \sqrt{21})} \right)^n + \frac{3}{14} \cdot (7 - \sqrt{21}) \cdot \sum_{n=0}^\infty \left( \frac{x}{6(-3 - \sqrt{21})} \right)^n. $$
Combining this with the earlier expression, we write the final form as:
$$ f(x) = -\frac{4}{3} + \frac{4}{3} \cdot g(x), $$
which expands to:
$$ f(x) = -\frac{4}{3} + \frac{4}{3} \cdot \left[ \frac{3}{14} \cdot (7 + \sqrt{21}) \cdot \sum_{n=0}^\infty \left( \frac{x}{6(-3 + \sqrt{21})} \right)^n + \frac{3}{14} \cdot (7 - \sqrt{21}) \cdot \sum_{n=0}^\infty \left( \frac{x}{6(-3 - \sqrt{21})} \right)^n \right]. $$
However, when I compare this result to the Taylor expansion of the original function:
$$ f(x) = 4x + 16x^2 + 60x^3 + 228x^4 + 864x^5, $$
the coefficients $(4, 16, 60, 228, 864, \dots)$, which represent the possible combinations in my counting problem, do not match the coefficients obtained from my final expression. For n=0 i need the expression to be equal to 1.
Edit: correcting the polynomial division result from $ f(x) = \frac{4}{3} - \frac{4}{3} \cdot \frac{1}{1 - 3x - 3x^2}. $ to $ f(x) = -\frac{4}{3} + \frac{4}{3} \cdot \frac{1}{1 - 3x - 3x^2}. $
My question is: What have I done wrong? Am I using an incorrect approach, or do I have a misunderstanding about some concept?