Let $\varphi$ be a normalized, well-behaved function that satisfies the boundary conditions of the problem (called test function). The variational theorem says that: \begin{equation}\label{ecu1} \int\varphi^{\ast}\hat{H}\varphi dq\geq E_0 \end{equation} Where $E_0$ is the energy of the state fundamental.

Demonstration:

The variational integral given by the equation (\ref{ecu1}) can be written in the following form: \begin{equation}\label{ecu2} \int\varphi^{\ast}\left(\hat{H}- E_0 \right)\varphi dq\geq 0 \end{equation} Let $\varphi=\sum_{i} c_i \psi_i$, where $\psi_i$ is the eigenfunctions of the Hamiltonian operator $\hat{H}\psi_i=E_i \psi_i$ \begin{equation} \int\sum_{i}c_{i}^\ast \psi_{i}^\ast\left(\hat{H}-E_{0}\right)\sum_{i }c_{j}\psi_j dq=\sum_{i}c_{i}^{\ast}\sum_{j}c_j\int\psi_{i}^{\ast}\left(\hat{H}- E_0\right)\psi_j dq= \nonumber \end{equation} \begin{equation} \sum_{i}c_{i}^{\ast}\sum_{j}c_j\left[\int\psi_{i} ^{\ast}\hat{H}\psi_j dq-\int\psi_{i}^{\ast}E_0 \psi_j dq\right]=\sum\left|c_i\right|^2\left(E_i- E_0\right)\geq0 \end{equation}