The well-known Hellmann–Feynman theorem of quantum mechanics connected with the derivative of the eigenvalues with respect to a parameter upon which the Hamiltonian depends, is generalized to include cases in which the domain of definition of the Hamiltonian of the system also depends on that parameter.