Certain partial integrations in quantum mechanics In classical quantum mechanics (and specifically in the introductury texts on this topic) while calculating expectation values of certain operators in the Schrödinger approach we often have to do partial integrations such as:
$$\int_{\mathbb{R}} \overline{\psi(x)} \psi''(x) \mathrm{d}x = - \int_{\mathbb{R}} \overline{\psi'(x)} \psi'(x) \mathrm{d}x$$
or more general
$$\int_{\mathbb{R}} \overline{A\psi(x)} (B\psi)'(x) \mathrm{d}x = - \int_{\mathbb{R}} \overline{(A\psi)'(x)} B\psi(x) \mathrm{d}x$$
for certain operators $A$ and $B$.
The dropping of the boundary term which usually features partial integration is most often wrongly justified by the false belief that 
$\psi$ is square integrable implies that it is decaying to zero at infinity.
(even in cases that $\psi$ ís square integrable and does decay to zero, $\psi' \psi$ does not have to satisfy any of both conditions).  
Question: is there some "natural" condition or observation on the properties of $\psi$ (or the set of functions where it comes from) by which we can generically justify the dropping of the boundary terms in the above partial integrations?
With "natural" I mean: can we give this property a physical interpretation within the q.m. framework?
(generalisation to other domains than just $\mathbb{R}$ is of course also welcome) 
 A: A key-word/phrase relevant here is "essential self-adjoint-ness": if we start with the Laplacian on test functions on $\mathbb R^n$, certainly the integration by parts formula is correct, because the boundary terms are literally zero. The "essential" self-adjointness is the (non-trivial) provable assertion that the (graph-) closure of this operator (densely defined on $L^2$) is its unique self-adjoint extension. Further, necessarily this graph-closure is identical with the Friedrichs extension. 
This does not preclude a variety of self-adjoint extensions of restrictions or of perturbations of it.
A useful auxiliary point is that, yes, while square integrability does not imply pointwise decay, various Sobolev inequalities prove growth restrictions... whose details depend on the dimension and how many derivatives we have in $L^2$. This is not exactly the same as the question of the validity of the integration by parts "extension", perhaps addressing more details than are strictly necessary to understand the self-adjointness of the Laplacian. On the other hand, indeed, that self-adjointness does not address details of pointwise behavior, such as may be needed for applications.
A: In general, integration by parts can be tricky in the context of quantum mechanics. Very often people consider potentials which are not $C^\infty$, or even the Dirac delta distribution (so the wavefunctions are not necessarily $C^\infty$). Then omission of some terms do no lead just to mathematical subtleties, but errors resulting in very different numerical results.
When it comes to integration by parts, even when the limits do not go to zero it might be argued that 'in some sense' it oscillates and can be averaged out to zero.
Also, it may be possible that such pathologies occur only for systems with infinite energies.
Moreover, a wavefunction $\psi$ (which is square-integrable) is arbitrarily close to another wavefunction with compact support. And from the physical point of view, we always work with an approximated wavefunction (and most likely - on a finite interval, just for the numerical or experimental feasibility). 
