When should I use partial fractions in generating functions I am currently studying generating functions and I don't understand why should I use partial fraction decomposition when solving $x^n$ coefficient of a question.
For example, in this function
$$\frac{1}{(1-x)(1-2x)^2} $$
Why should I use partial fractions to divide it to this expression
$$\frac{1}{1-x} - \frac{2}{1-2x} + \frac{2}{(1-2x)^2} = \sum_{i=0}^\infty \left(x^i - 2(2x)^i + 2 \binom{i+1}{1}(2x)^i\right) $$
to get the coefficient of $x^n$ and not transfer it to sums from the start like
$\begin{array}{cc}\frac{1}{1-x} = \sum_{i=0}^\infty x^i & \frac{1}{(1-2x)^2} = \sum_{i=0}^\infty \binom{i+1}{1}x^i \end{array}$
Therefore,
$$\frac{1}{(1-x)(1-2x)^2}  = \sum_{i=0}^\infty x^i * \sum_{i=0}^\infty \binom{i+1}{1}x^i$$
and then find the coefficient from convolution.
Or this function instead of doing partial fraction I can do this
$$\frac{1 - x^2}{(1-x)^3} = (1-x^2) * \sum_{i=0}^\infty \binom{i+2}{2}x^i$$
and use convolution again
 A: First example:
The partial fraction decomposition in the first case is a  convenient representation since we can directly derive a closed formula (without sums) from it. Denoting with $[x^n]$ the coefficient of $x^n$ of a series we obtain at a glance
\begin{align*}
[x^n]\left(\frac{1}{1-x} - \frac{2}{1-2x} + \frac{2}{(1-2x)^2}\right)
&=1-2\cdot2^{n}+2(n+1)2^n\\
&\,\,\color{blue}{=1+n2^{n+1}}\tag{1}
\end{align*}
On the other hand, if we consider instead
\begin{align*}
\frac{1}{(1-x)}\frac{1}{(1-2x)^2}
\end{align*}
we know the right-hand term admits the binomial expansion
\begin{align*}
\frac{1}{(1-2x)^2}&=\sum_{n=0}^\infty\binom{-2}{n}(-2x)^n\\
&=\sum_{n=0}^\infty(n+1)(2x)^n\tag{2}
\end{align*}
Multiplication with the term $\frac{1}{1-x}$ has the nice property
\begin{align*}
\frac{1}{1-x}\sum_{n=0}^\infty a_nx^n=\sum_{n=0}^\infty\left(\sum_{k=0}^na_k\right)x^n
\end{align*}
to transform coeffcients $a_n$ to the sum $\sum_{k=0}^n a_k$. It follows from (2) the wanted coefficient
\begin{align*}
[x^n]\frac{1}{(1-x)}\frac{1}{(1-2x)^2}=\color{blue}{\sum_{k=0}^n(k+1)2^k}\tag{3}
\end{align*}
Comparison of (1) and (3) gives
\begin{align*}
\color{blue}{\sum_{k=0}^n(k+1)2^k=1+n2^{n+1}}
\end{align*}
Note, without comparison we need some additional steps in order to simplify (3) into the closed form (1).
Second example:
Here we can easily derive the coefficient without partial fraction decomposition. We obtain for $n\geq 0$:
\begin{align*}
[x^n]\frac{1-x^2}{(1-x)^3}&=[x^n]\frac{1+x}{(1-x)^2}\\
&=[x^n](1+x)\sum_{k=0}^\infty (k+1)x^n\\
&=\left([x^n]+[x^{n-1}]\right)\sum_{k=0}^\infty (k+1)x^n\\
&\,\,\color{blue}{=2n+1}
\end{align*}
Conclusion: It depends on the specific situation if partial fraction decomposition is the convenient approach or some alternative techniques are more appropriate instead.
