The Hellmann–Feynman theorem is actually a direct, and to some extent trivial, consequence of the variational principle (the Rayleigh-Ritz variational principle) from which the Schrödinger equation may be derived. This is why the Hellmann–Feynman theorem holds for wave-functions (such as the Hartree–Fock wave-function) that, though not eigenfunctions of the Hamiltonian, do derive from a variational principle. This is also why it holds, e.g., in density functional theory, which is not wave-function based and for which the standard derivation does not apply.
According to the Rayleigh–Ritz variational principle, the eigenfunctions of the Schrödinger equation are stationary points of the functional (which is nicknamed Schrödinger functional for brevity):
The eigenvalues are the values that the Schrödinger functional takes at the stationary points:
where  satisfies the variational condition:
By differentiating Eq. (3) using the chain rule, the following equation is obtained:
Due to the variational condition, Eq. (4), the second term in Eq. (5) vanishes. In one sentence, the Hellmann–Feynman theorem states that the derivative of the stationary values of a function(al) with respect to a parameter on which it may depend, can be computed from the explicit dependence only, disregarding the implicit one. On account of the fact that the Schrödinger functional can only depend explicitly on an external parameter through the Hamiltonian, Eq. (1) trivially follows.