How to find a general term of a trinomial? I want to find the coefficient of $x^0$ in the expansion of  $(x + 1 + 1/x)^4$.
Without an expansion, I keep getting "nested binomial" terms if I group two terms together:
$$\binom{4}{k}\binom{k}{m} (x)^{k-m}(1/x)^{m}$$
For which $k-2m = 0$. I cannot solve further without guessing and checking a value. What is a better way?

We can also apply the binomial theorem twice in order to derive the cofficient of $x^0$. We use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ of a series. This way we can write for instance
\begin{align*}
[x^k](1+x)^n=\binom{n}{k}
\end{align*}

We obtain
\begin{align*}
\color{blue}{[x^0]}&\color{blue}{\left(\left(x+1\right)+\frac{1}{x}\right)^4}\\
&=[x^0]\sum_{k=0}^4\binom{4}{k}\left(\frac{1}{x}\right)^k(x+1)^{4-k}\tag{1}\\
&=\sum_{k=0}^4\binom{4}{k}[x^k](x+1)^{4-k}\tag{2}\\
&=\sum_{k=0}^4\binom{4}{k}\binom{4-k}{k}\tag{3}\\
&=\binom{4}{0}\binom{4}{0}+\binom{4}{1}\binom{3}{1}+\binom{4}{2}\binom{2}{2}\tag{4}\\
&=1\cdot 1+4\cdot 3+6\cdot 1\\
&\,\,\color{blue}{=19}
\end{align*}
Note that we do not need any guessing in order derive the wanted coefficient.

Comment:

*

*In (1) we apply the binomial theorem the first time.


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


*In (3) we select the coefficient of $x^k$ by applying the binomial theorem a second time.


*In (4) we write the terms of the sum explicitely noting that $\binom{4-k}{k}=0$ for $k=3,4$.
