It has been recently proven that the bound states of the one-dimensional Schr\odinger equation H${\mathrm{\ensuremath{\psi}}}^{(\mathit{i})}$=${\mathit{E}}^{(\mathit{i})}$${\mathrm{\ensuremath{\psi}}}^{(\mathit{i})}$ in [0,\ensuremath{\infty}) can be approximated by those of the corresponding Dirichlet eigenproblem ${\mathit{H}}_{\mathit{R}}$${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{i})}$=${\mathit{E}}_{\mathit{R}}^{(\mathit{i})}$${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{i})}$ in a finite box [0,R] when R\ensuremath{\rightarrow}\ensuremath{\infty}. In this paper, we use a set of mathematical criteria that guarantee the correct calculation of expectation values in the frame of Hilbert spaces, to show that correct expectation values of most physical operators S are obtained by using the equation ${\mathrm{lim}}_{\mathit{R}\ensuremath{\rightarrow}\mathrm{\ensuremath{\infty}}}$〈${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{i})}$,S${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{j})}$〉= 〈${\mathrm{\ensuremath{\psi}}}^{(\mathit{i})}$,S${\mathrm{\ensuremath{\psi}}}^{(\mathit{j})}$〉, which includes operators not relatively form bounded by the Hamiltonian H. It is shown that standard numerical methods supply approximate wave functions ${\mathrm{\ensuremath{\psi}}}_{\mathit{R}\mathit{m}}^{(\mathit{i})}$ for which the equation ${\mathrm{lim}}_{\mathit{m}\ensuremath{\rightarrow}\mathrm{\ensuremath{\infty}}}$〈${\mathrm{\ensuremath{\psi}}}_{\mathit{R}\mathit{m}}^{(\mathit{i})}$,S${\mathrm{\ensuremath{\psi}}}_{\mathit{R}\mathit{m}}^{(\mathit{j})}$〉= 〈${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{i})}$,S${\mathrm{\ensuremath{\psi}}}_{\mathit{R}}^{(\mathit{j})}$〉 holds true. Thus, combining the previous limits we obtain a general approach to compute correct expectation values. It is shown how this approach agrees with the results found by other authors in special cases. In the particular case of computing approximate wave functions ${\mathrm{\ensuremath{\psi}}}_{\mathit{R}\mathit{m}}^{(\mathit{i})}$ with the Ritz method, we show, analytically and numerically, that correct convergence toward the expectation values of high power of moment operators ${\mathit{r}}^{\mathit{k}}$ holds even when the basis functions have an analytic structure that substantially differs from that of the exact wave function.