Is the variational method valid when discrete spectrum eigenfunctions are in finite number? In the proof of the variational method to estimate the ground state energy of a system, that is
$$
\newcommand{\ket}[1]{\lvert{#1}\rangle}
\newcommand{\bra}[1]{\langle{#1}\rvert}
\newcommand{\braket}[2]{\langle{#1}|{#2}\rangle}
E_0\le \frac{\bra{\psi}H\ket{\psi}}{\braket{\psi}{\psi}}
$$
for any $\ket{\psi}$, I always read that we "ignore the presence of a continuous spectrum" and pretend that the eigenstates associated to the discrete eigenvalues form a complete basis, i.e.
$$
\sum_n\ket{n}\bra{n}=1
$$
and go on expanding $\ket{\psi}$ as a linear combination of these $\ket{n}$ states.
I encountered, however, in some exercises some potentials that do not even have an infinite number of eigenstates, let alone a complete set, e.g. finite rectangular wells in one dimension, or the potential
$$
V(x)=-\frac{\hbar^2}{ma^2\cosh^2(x/a)}
$$
which has just one bound state.
In these cases and similar ones the assumptions for the variational method don't hold, so is that theorem always valid (but the proof is different) or do I have to check that indeed a complete set of eigenfunctions exists associated to the discrete spectrum?
 A: The variational method comes from the mathematical statement, that, for any self-adjoint operator $A$ on some Hilbert space $H$ with scalar product $(\cdot,\cdot)$, there holds
$$
\inf\sigma(A)=\inf_{\psi\in D(A), \|\psi\|=1} (\psi,A\psi)
$$this can be found in any textbook on operator theory. In QM, where $E_0:=\inf\sigma(H)$, where $H$ is the Hamiltonian, therefore your inequality
$$
\newcommand{\ket}[1]{\lvert{#1}\rangle}
\newcommand{\bra}[1]{\langle{#1}\rvert}
\newcommand{\braket}[2]{\langle{#1}|{#2}\rangle}
E_0\le \frac{\bra{\psi}H\ket{\psi}}{\braket{\psi}{\psi}}
$$ holds true for any Hamiltonian, as $H$ is always assumed to be self-adjoint. However, you have to be a bit careful with your $\psi$, as you have the nontrivial restriction $\psi\in D(H)$, i.e. your test function should be in the domain of $H$, or more precisely, the self-adjoint version of $H$. However, most common test functions are sufficiently well-behaved, such that you don't have to take care of these mathematical subtleties. "Good behavior" is in most cases sufficient smoothness (e.g. $C^2$) and a fast decay at infinity.
