Let \(k\) be a field, let \(f\in k[x]\) be irreducible and separable of degree \(n\), let \(L\) be a splitting field of \(f\) over \(k\), and let \(G\coloneqq\Gal(L/k)\).
\(L/k\) is Galois, and \(\abs G=[L:k]\).
The action of \(G\) on the \(n\) roots of \(f\) identifies \(G\) with a transitive subgroup of \(S_n\), well defined up to conjugation, and \(n\divides\abs G\divides n!\).
\(L\) is the splitting field of the separable polynomial \(f\), so \(L/k\) is Galois and \(\abs G=[L:k]\) (PR-ZCKLJ).
An element of \(G\) permutes the roots \(\alpha_1,\ldots,\alpha_n\) of \(f\) and is determined by this permutation because \(L=k(\alpha_1,\ldots,\alpha_n)\); reordering the roots conjugates the image in \(S_n\). For each \(i\) there is a \(k\)-isomorphism \(k(\alpha_1)\to k(\alpha_i)\) with \(\alpha_1\mapsto\alpha_i\), since \(f\) is irreducible, and it extends to an element of \(G\), so the action is transitive. Then \(n=[k(\alpha_1):k]\) divides \([L:k]=\abs G\), and \(\abs G\) divides \(\abs{S_n}=n!\).
These facts give a procedure for computing \(G\). Check that \(f\) is irreducible and separable, compute \([L:k]=\abs G\), and list the transitive subgroups of \(S_n\) of that order. The remaining candidates are separated by the cycle types that occur in \(G\), read off from factorizations of \(f\) modulo primes when \(k=\QQ\) (PR-XDWOP), or, for cubics, by the discriminant (PR-XPDHE).