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?
 A: One approach is to multiply by $x^4$ and then find the coefficient of $x^4$ in the result.
Notation: $[x^n]f(x)$ denotes the coefficient of $x^n$ in $f(x)$. Then
$$\begin{align}
[x^0](x+1+1/x)^4 &= [x^4]x^4 (x+1+1/x)^4 \\
&=[x^4](x^2+x+1)^4 \\
&=[x^4] \left( \frac{1-x^3}{1-x} \right)^4 \\
&=[x^4](1-x^3)^4 \;(1-x)^{-4} \\
&=[x^4](1 -4x^3 +O(x^6)) \sum_{i=0}^{\infty} \binom{4+i-1}{i} x^i \tag{*} \\
&= \binom{4+4-1}{4} - 4 \binom{4+1-1}{1} \\
&= 19
\end{align}$$
where at $(*)$ we have used the Binomial Theorem for negative exponents.
A: I am not sure if this is actually a better way but it is probably a much clearer approach.
Case 1: You take no $x$ from either of the brackets, so you cannot take $1/x$ from any of the brackets too.
$$C_1 = \binom{4}{0}\binom{4}{0} = 1$$
Case 2: You take one $x$ from one of the brackets, so you need to take $1/x$ from the remaining brackets and the rest should be $1$.
$$C_2 = \binom{4}{1}\binom{3}{1} = 12$$
Case 3: You take two $x$ from two of the brackets, so you need the remaining ones to be $1/x$.
$$C_3 = \binom{4}{2}\binom{2}{2} = 6$$
Final answer: $19$
A: Remember this method can be explaineed by expansion but doesn't really need expansion:
$$ \left(a+b+c\right)^4:\quad a^4+4a^3b+4a^3c+6a^2b^2+6a^2c^2+12a^2bc+4ab^3+4ac^3+12abc^2+12ab^2c+ b^4+c^4+4bc^3+6b^2c^2+4b^3c$$
or
$$ a^4+b^4+c^4= $$ 
Now you need not expand it. Just use logic.
$6a^2c^2+12ab^2c$ will only result in coefficient having $a^0$. Basicly focus on the terms having $a$ and $c$ with same power.  Did you understood this?
A: Consider
$$(x + 1 + 1/x)^4=\frac{(x^2+x+1)^4}{x^4}$$ then we want to find the coefficient of $x^4$ in the expansion $(x^2+x+1)^4$. Note you don't need to do this and can just apply the below method to $(x + 1 + 1/x)^4$.
Using the multinomial theorem (in this case it is called the trinomial expansion) we have $$
(x_1+x_2+x_3)^n=\sum_{k_1+k_2+k_3=n}\binom{n}{k_1,k_2,k_3}x_1^{k_1}x_2^{k_2}x_3^{k_3}
$$
where $\dbinom{n}{k_1,k_2,k_3} = \dfrac{n!}{k_1! \, k_2! \, k_3!}$.
Setting $n=4,x_1=x^2,x_2=x$ and $x_3=1$, we want $x_1^{k_1}x_2^{k_2}=x^4,$ which is equivalent to $2k_1+k_2=4$, where $k_1+k_2\leq 4$ and $k_1+k_2+k_3=4$. There's only a few values to check.
Thus the coefficient is $\dbinom{4}{0,4,0}+\dbinom{4}{1,2,1}+\dbinom{4}{2,0,2}=19.$
A: 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$.
