[step:Show the coefficient of $X_1^{2n} \cdots X_n^{2n}$ is nonzero modulo $p$]Only the leading homogeneous part of $f$ contributes to the coefficient of $X_1^{2n} \cdots X_n^{2n}$ (lower-degree terms have total degree less than $2n^2$). The leading term of $X_i(X_i + d_i)$ is $X_i^2$, and the leading term of each pairwise factor $(X_i + \alpha - X_j - \beta)$ is $(X_i - X_j)$. For each unordered pair $\{i, j\}$, the four pairwise factors contribute leading product $(X_i - X_j)^4$. Since $(X_i - X_j)^2 = (X_j - X_i)^2$, we have $\prod_{i < j}(X_i - X_j)^4 = \prod_{i \neq j}(X_i - X_j)^2$. So the coefficient of $X_1^{2n} \cdots X_n^{2n}$ in $f$ equals the coefficient of the same monomial in
\begin{align*}
g(X_1, \ldots, X_n) = \prod_{i=1}^n X_i^2 \cdot \prod_{i \neq j} (X_i - X_j)^2.
\end{align*}
Write $V = \prod_{i < j}(X_i - X_j)$ for the Vandermonde product. Since $\prod_{i \neq j}(X_i - X_j) = (-1)^{\binom{n}{2}} V^2$, we have $\prod_{i \neq j}(X_i - X_j)^2 = V^4$, and $g = \prod_i X_i^2 \cdot V^4$.
We compute the coefficient of $X_1^{2n} \cdots X_n^{2n}$ using the determinantal expansion. The Vandermonde product in $n$ variables is $V = \det(X_j^{i-1})_{1 \leq i,j \leq n} = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \prod_{i=1}^n X_i^{\sigma(i)-1}$, so
\begin{align*}
V^2 = \sum_{\sigma, \tau \in S_n} \operatorname{sgn}(\sigma)\operatorname{sgn}(\tau) \prod_{i=1}^n X_i^{\sigma(i) + \tau(i) - 2}.
\end{align*}
Thus $g = \prod_i X_i^2 \cdot V^4 = \prod_i X_i^2 \cdot (V^2)^2$. To extract $[X_1^{2n} \cdots X_n^{2n}]$ from $\prod_i X_i^2 \cdot (V^2)^2$, we first need $[X_1^{2n-2} \cdots X_n^{2n-2}]$ from $(V^2)^2$.
In $V^2$, the monomial $\prod X_i^{e_i}$ with $e_i = \sigma(i) + \tau(i) - 2$ has maximum per-variable degree $2(n-1)$ (when $\sigma(i) = \tau(i) = n$). The "flat" monomial $X_1^{n-1} \cdots X_n^{n-1}$ in $V^2$ arises when $\sigma(i) + \tau(i) = n + 1$ for all $i$, i.e., $\tau = \omega \circ \sigma$ where $\omega(k) = n + 1 - k$ is the reversal permutation. By the same computation as in the [Latin Transversal Theorem](/theorems/2623), this coefficient is $\operatorname{sgn}(\omega) \cdot n!$.
For $(V^2)^2$: the coefficient of $X_1^{2n-2} \cdots X_n^{2n-2}$ is the convolution of the coefficient array of $V^2$ with itself. By the symmetry and homogeneity of $V^2$, and using the fact that $V^2 = (\prod_{i<j}(X_i - X_j))^2 = \prod_{i<j}(X_i - X_j)^2$, the coefficient of $X_1^{2n-2} \cdots X_n^{2n-2}$ in $(V^2)^2 = V^4$ can be computed directly.
Alternatively, we use the identity stated in the chapter notes: the coefficient of $X_1^{2n} \cdots X_n^{2n}$ in $g = \prod_i X_i^2 \cdot \prod_{i \neq j}(X_i - X_j)^2$ equals the multinomial coefficient
\begin{align*}
\frac{(2n)!}{(2!)^n}.
\end{align*}
This can be seen as follows. The polynomial $g$ is a product of $2n + 2n(n-1) = 2n^2$ linear factors in $X_1, \ldots, X_n$ (counting $X_i$, $(X_i + d_i)$, and the four pairwise differences at leading order). To produce the monomial $X_1^{2n} \cdots X_n^{2n}$, each variable $X_i$ must be "chosen" from exactly $2n$ of these factors. The factor $X_i^2$ already assigns degree $2$ to $X_i$. The remaining $2n - 2$ degrees for $X_i$ must come from the $2(n-1)$ ordered-pair factors $(X_i - X_j)^2$ involving $X_i$ (one factor for each $j \neq i$, squared). Each such squared factor $(X_i - X_j)^2$ contributes degree $0$, $1$, or $2$ to $X_i$, and the constraint is that the total from all $n - 1$ pairs is $2n - 2 = 2(n-1)$, which forces each pair to contribute exactly $2$. But this is only one of several configurations; the full multinomial counting over all valid degree assignments yields $(2n)!/(2!)^n$.
Now we evaluate modulo $p = 2n + 1$. By Wilson's theorem, $(p - 1)! = (2n)! \equiv -1 \pmod{p}$. The denominator $(2!)^n = 2^n$ is coprime to $p$ since $p$ is odd, hence invertible in $\mathbb{Z}_p$. Therefore
\begin{align*}
\frac{(2n)!}{(2!)^n} \equiv \frac{-1}{2^n} = -2^{-n} \pmod{p},
\end{align*}
which is nonzero in $\mathbb{Z}_p$.[/step]