The multinomial theorem dictates that $$\sum_{\mu_0+\mu_1+\cdots+\mu_M=N}\binom{N}{\mu_0,\mu_1,\cdots,\mu_M}x_0^{\mu_0}x_1^{\mu_1}\cdots x_M^{\mu_M}=(x_0+x_1+\cdots+x_M)^N.$$ Here, the multinomial coefficient $\binom{N}{\mu_0,\mu_1,\cdots,\mu_M}=N!/(\mu_0!m_1!\cdots \mu_M!)$ automatically eliminates terms where the $\{\mu_i\}$ do not sum to $N$ or are negative; the sum is over all integer values of $\mu_i\geq 0$. What happens when we add additional constraints to the set $\{\mu_i\}$? Specifically, I am wondering if there is a closed-form solution (or a straightforward method to approach such a solution) for the sum with the [linear] constraint $\sum_k k\mu_k=m$: $$f(x_0,x_1,\cdots,x_M;N,m)=\sum_{\sum_{k=0}^M\mu_k=N,\,\sum_{k=0}^M k \mu_k=m,\, 0\leq \mu_k}\binom{N}{\mu_0,\mu_1,\cdots,\mu_M}\prod_{k=0}^M x_k^{\mu_k}?$$
Normally, the multinomial theorem as written gives us $M+1$ sums with one constraint, leading to summation over $M$ indices; now I am wondering about summation over $M-1$ indices (if there is a general answer for more constraints that is even better). We can write my constraints as $$\mu_1=m-\sum_{k>1}k\mu_k;\qquad \mu_0=N-\sum_{k>0}\mu_k=N-m+\sum_{k>1}(k-1)\mu_k$$ to find the expression $$f(x_0,x_1,\cdots,x_M;N,m)=\sum_{\mu_2,\mu_3,\cdots,\mu_M=0}^N\binom{N}{N-m+\sum_{k>1}(k-1)\mu_k,m-\sum_{k>1}k\mu_k,\mu_2,\cdots,\mu_M}x_0^{N-m+\sum_{k>1}(k-1)\mu_k}x_1^{m-\sum_{k>1}k\mu_k}\prod_{k>1}x_k^{\mu_k}.$$ I have now written this explicitly as $M-1$ sums over the $\mu_{k>1}$ indices, where the multinomial coefficient will vanish when any of the constraints are not met (indices summing to $N$, linear combination of indices summing to $m$, $\mu_0$ or $\mu_1$ accidentally being outside of the range from $0$ to $N$). This is actually easy to evaluate for $M=1$, the binomial theorem, because then the linear constraint tells us that $\mu_1=m$ and the sum collapses to a single term: $$f(x_0,x_1;N,m)=\binom{N}{m}x_0^{N-m}x_1^m.$$ When I compute the same thing using Mathematica for $M=2$, I find another collapse to a more complicated term: $$f(x_0,x_1,x_2;N,m)=\sum_{\mu_{2}=\max[0,m-N]}^{\min[N,m/2]}\binom{N}{N-m+\mu_2,m-2\mu_2,\mu_2}x_0^{\mu_0}x_1^{\mu_1}x_2^{\mu_2}=\begin{array}{cc} \bigg\{ & \begin{array}{cc} \text{x1}^m \binom{N}{N-m} x_0^{N-m} \, _2F_1\left(\frac{1-m}{2},-\frac{m}{2};-m+N+1;\frac{4 x_0x_2}{x_1^2}\right) & m\leq N \\ \binom{N}{m-N} x_1^{2 N-m} x_2^{m-N} \, _2F_1\left(\frac{1}{2} (m-2 N),\frac{1}{2} (m-2 N+1);m-N+1;\frac{4 x_0x_2}{x_1^2}\right) & N<m\leq 2N \\ \end{array} \\ \end{array} .$$ This automatically incorporates the requirement that $2N\geq m$ implied by the pair of constraints. This answer is not so simple, so I wonder if there is a way to simplify these sums in general. Any thoughts, tips, strategies?