Extracting coefficients from a generating function Recently, I found that the generating function for a sequence I am interested in is
$$s(x) = -\frac{3 \, x^{3} + x^{2} + 2 \, x}{2 \, x^{3} + x - 1}.$$
Naturally, I am now keen on extracting the $n$th coefficient of the Taylor expansion of $s(x)$ without the help of a computer. Unfortunately, the three roots of the denominator of $s(x)$, of which two are complex, are rather unfriendly creatures, so that partial fraction decomposition does not seem to be a viable method.
But what can I do then to find the desired coefficients?
Thank you!

We can derive the $n$-th coefficient by makeing a geometric series expansion of
\begin{align*}
\color{blue}{s(x)}&\color{blue}{=-\frac{3x^3+x^2+2x}{2x^3+x-1}}\\
&\color{blue}{=2x+3x^2+6x^3+10x^4+16x^5+28x^6+\cdots}
\end{align*}
We use the coefficient of operator $[x^n]$ to derive the coefficient of $x^n$ of a series.

We obtain
\begin{align*}
\color{blue}{[x^n]}&\color{blue}{s(x)}
=[x^n]\left(-\frac{3x^3+x^2+2x}{2x^3+x-1}\right)\\
&=\left(3[x^{n-3}]+[x^{n-2}]+2[x^{n-1}]\right)\frac{1}{1-x\left(1+2x^2\right)}\tag{1}\\
&=\left(3[x^{n-3}]+[x^{n-2}]+2[x^{n-1}]\right)\sum_{k=0}^{\infty}x^k\left(1+x^2\right)^k\tag{2}\\
&=3\sum_{k=0}^{n-3}[x^{n-3-k}]\left(1+2x^2\right)^k
+\sum_{k=0}^{n-2}[x^{n-2-k}]\left(1+2x^2\right)^k\\
&\qquad\qquad+2\sum_{k=0}^{n-1}[x^{n-1-k}]\left(1+2x^2\right)^k\tag{3}\\
&=3\sum_{k=0}^{n-3}[x^{k}]\left(1+2x^2\right)^{n-3-k}
+\sum_{k=0}^{n-2}[x^{k}]\left(1+2x^2\right)^{n-2-k}\\
&\qquad\qquad+2\sum_{k=0}^{n-1}[x^{k}]\left(1+2x^2\right)^{n-1-k}\tag{4}\\
&=3\sum_{k=0}^{\left\lfloor\frac{n-3}{2}\right\rfloor}[x^{2k}]\left(1+2x^2\right)^{n-3-2k}
+\sum_{k=0}^{\left\lfloor\frac{n-2}{2}\right\rfloor}[x^{2k}]\left(1+2x^2\right)^{n-2-2k}\\
&\qquad\qquad+2\sum_{k=0}^{\left\lfloor\frac{n-1}{2}\right\rfloor}[x^{2k}]\left(1+2x^2\right)^{n-1-2k}\tag{5}\\
&\color{blue}{=3\sum_{k=0}^{\left\lfloor\frac{n-3}{2}\right\rfloor}\binom{n-3-2k}{2k}2^{k}
+\sum_{k=0}^{\left\lfloor\frac{n-2}{2}\right\rfloor}\binom{n-2-2k}{2k}2^{k}}\\
&\qquad\qquad\color{blue}{+\sum_{k=0}^{\left\lfloor\frac{n-1}{2}\right\rfloor}\binom{n-1-2k}{2k}2^{k+1}}\tag{6}\\
\end{align*}

Comment:

*

*In (1) we use the rule $[x^{p-q}]A(x)=[x^p]x^qA(x)$.


*In (2) we make a geometric series expansion.


*In (3) we again apply the rule as in (1). We also restrict the upper limit since other terms do not contribute.


*In (4) we change the order of summation $k\to n-a-k, a=1,2,3$.


*In (5) we respect that only even powers contribute.


*In (6) we select the coefficients accordingly.
