  We obtain accurate eigenvalues of the one-dimensional Schr\"odinger equation
with a Hamiltonian of the form $H_{g}=H+g\delta (x)$, where $\delta (x)$ is the
Dirac delta function. We show that the well known Rayleigh-Ritz variational
method is a suitable approach provided that the basis set takes into account
the effect of the Dirac delta on the wavefunction.
