Show that a particular symmetric sum is $0$ or $1$ Given $x_1, \ldots, x_n$ some numbers, and $0 \leq d \leq n-1$, how can I show that \begin{align*}\sum_{i=1}^n \frac{x_i^d}{\prod\limits_{\substack{j=1\\j\neq i}}^n(x_i-x_j)} = \begin{cases} 0 &\text{if } 0 \leq d < n-1\\1 &\text{if }d=n-1\end{cases}\end{align*} (or is this even true - as far as I can tell it holds for any choices of $x_1,\ldots, x_n$ distinct)
I see the case $d=0$ has been answered here. Thanks!
 A: Similar to as in the linked post, let:
\begin{align*}
q(T) = \sum_{i=1}^n \left(\prod_{j\neq i} \left(\frac{T-x_i}{x_j-x_i} - 1 \right)\right)
\end{align*}
$q(T)$ has the following properties:

*

*The degree of $q$ (as a polynomial in $T$) must be $\leq n-1$, as each term in the sum is a product of $n-1$ monic terms in $T$.


*At $T=x_k$ say, in each term in the sum where $i \neq k$, $j=k$ occurs in the inner product. So that product contains a factor of $\left(\frac{x_k-x_i}{x_k-x_i} -1\right) = (1-1) = 0$, and hence that term vanishes, leaving only the term $i=k$. Hence:
\begin{align*}
q(x_k) = \prod_{j\neq k}\left(\frac{x_k-x_k}{x_j-x_k}-1\right)=\prod_{j\neq k}(-1) = (-1)^{n-1}
\end{align*}
So $q(T) - (-1)^{n-1}$ is a polynomial of degree $\leq n-1$ with $n$ distinct zeros (at each of the $x_k$), so is constant zero, and so $q(T) \equiv (-1)^{n-1}$.
Now consider the coefficients of $T^{(n-1)-d}$.

*

*When $d <n-1$, the coefficient of $T^{(n-1)-d}$ is zero. On the other hand, expanding the product, the contributions to the $T^{(n-1)-d}$ coefficient from the $i$th term in the sum is $\frac{\binom{n-1}{d}(-1)^{d}x_i^d}{\prod_{j\neq i}(x_j-x_i)}$, and so
\begin{align*}
\binom{n-1}{d}(-1)^d\sum_{i=1}^n \frac{x_i^d}{\prod_{j\neq i}(x_j-x_i)} &= 0\\
\implies \sum_{i=1}^n \frac{x_i^d}{\prod_{j\neq i}(x_j-x_i)} &= 0
\end{align*}


*When $d = n-1$, the coefficient of $T^{(n-1)-d}$ is $(-1)^{n-1}$. Expanding as above:
\begin{align*}
\binom{n-1}{n-1}(-1)^{n-1}\sum_{i=1}^n \frac{x_i^{n-1}}{\prod_{j\neq i}(x_j-x_i)} &= (-1)^{n-1}\\
\implies \sum_{i=1}^n \frac{x_i^{n-1}}{\prod_{j\neq i}(x_j-x_i)} &= 1
\end{align*}
