Let us consider the multivariate polynomial ring $\mathbb{Q}[x_1,\dots,x_n]$. The symmetric group $S_n$ acts on this ring in the natural manner: if $\sigma \in S_n$ define $\sigma(x_i)=x_{\sigma(i)}$.
Question: we are given a polynomial $p(x_1,\dots,x_n)$ in this ring such that for every transposition $\sigma=(i\ j)\in S_n$ the value of $\sigma(p)$ is the same (not dependent on $i, j$). What can we say about $p$? What is its general form?
Answer: $p$ is of the form $\Delta\cdot q$ where $q$ is a symmetric polynomial and $\Delta$ is the Vandermonde polynomial $\Delta=\prod_{1\le i<j\le n}(x_i-x_j)$.
What I'm looking for: I want to know how this answer can be reached $without already knowing$ about the Vandermonde polynomial. Is there a logical way to deduce its form from the elements of the problem at hand, or must one have some "epiphany" in order to proceed with this problem?
Context: I am trying to explain to myself how the definition of discriminant arises naturally when attempting to solve polynomial equation of degree at most 4 using Galois theory (i.e. using Lagrange resolvant to explicitly find elements whose roots generate the splitting field of the polynomial).