TITLE: The number of terms in the Multinomial Expansion $(x+\frac{1}{x}+x^2+\frac{1}{x^2})^n$
QUESTION [5 upvotes]: I am aware that there is a formula to calculate the number of terms in a multinomial expression $(x_1+x_2+x_3+...x_r)^n$, i.e. $^{n+r-1}C_{r-1}$. However, this is in the case when the terms $x_1, x_2, x_3 ... x_r$ are different variables. In my case, the variables are the same; i.e. x, raised to different powers. Can someone please point me in the right direction?

REPLY [2 votes]: We obtain
  \begin{align*}
\color{blue}{\left(x+\frac{1}{x}+x^2+\frac{1}{x^2}\right)}&=\frac{1}{x^{2n}}(1+x+x^2+x^3)^n\\
&=\frac{1}{x^{2n}}\left(1+x+x^3\left(1+x\right)\right)^n\\
&=\frac{1}{x^{2n}}(1+x)^n(1+x^3)^n\\
&\color{blue}{=\frac{1}{x^{2n}}\sum_{j=0}^n\binom{n}{j}x^j\underbrace{\sum_{k=0}^n\binom{n}{k}x^{3k}}_{n+1\text{ terms}}}\tag{1}
\end{align*}

Let's have a look at the three factors in (1). 

The rightmost sum contains $n+1$ pairwise different terms with exponents $3k,0\leq k\leq n$.
The leftmost factor $\frac{1}{x^{2n}}$ does not change the number of different terms as it is just a shift of each exponent of $x$ by $-2n$.
Now we assume $n\geq 2$  and analyse the left sum. A multiplication with the first three terms $\binom{n}{0},\binom{n}{1}x,\binom{n}{2}x^2$ results in $3(n+1)$ terms 
\begin{align*}
\sum_{j=0}^n a_kx^{3k\color{blue}{+0}},\sum_{j=0}^n b_kx^{3k\color{blue}{+1}},\sum_{j=0}^n c_kx^{3k\color{blue}{+2}}
\end{align*}
which gives a sum of increasing powers of $x^k, 0\leq k\leq 3(n+1)$. Additionally we observe that whenever $n(>2)$ is increased by $1$, the overall number of terms is increased  by  $1$.  


We  conclude: The number of different terms in the expansion of $\left(x+\frac{1}{x}+x^2+\frac{1}{x^2}\right)^n$ is
  \begin{align*}
\color{blue}{1}&\qquad \color{blue}{n=0}\\
\color{blue}{4}&\qquad \color{blue}{n=1}\\
3(n+1)+(n-2)=\color{blue}{4n+1}&\qquad \color{blue}{n\geq 2}
\end{align*}