When does this integral vanish, which appears in the derivation of the quantum virial theorem? In the derivation of the quantum virial theorem by Slater (appendix of this article), the following term $A$ appears, which is said to vanish upon integration ($\bar \psi$ is the complex conjugate of $\psi$):
$$
A=\frac{\partial}{\partial x_i}\left[\bar\psi^2\frac{\partial}{\partial x_i}\left(\frac{\sum_jx_j\left(\frac{\partial \psi}{\partial x_j}\right)}{\bar \psi}\right)\right]
$$
This term is integrated over the whole domain of $\psi$:
$$\int A\mathrm{d} \tau=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\dots\int_{-\infty}^{+\infty}A\mathrm{d}x_1\mathrm{d}x_2\dots\mathrm{d}x_N$$.
This integral is said to be zero, since the following condition is fulfilled:
$$\lim_{x_i\to\pm\infty}\psi=0 \ \forall i$$
Is this trivial? Another article states, that there has to be a second condition.
$$\lim_{x_i \to \pm\infty}\frac{\partial \psi}{\partial x_j}=0 \ \forall i,j$$
Any appropriate wave function trivially fulfills both of these conditions, but that is not the point here.
(Is there even a function, which fulfills the first, but not the second? I only find examples for the other way around, e.g. the square root. Furthermore, any meaningful example would have to be square integrable, continuous, and nearly everywhere differentiable.):
My question is in general: If we integrate over any domain, under which conditions does the integral of A disappear?
and more specific: Does this integral also vanish, if $\psi$ is not everywhere zero on the domain surface, but the flux of the gradient vector field $\nabla|\psi|^2$ is zero everywhere on the surface? (i.e. not only the net flux of the total surface is zero, but the local flux is zero everywhere)
PS: if this helps, we can also discuss $\sum_i A$ instead of $A$ alone.
PPS: regarding the specific question, I thought it calls out for applying the convergence theorem, but I don't know, if that helps.
 A: Notice that:
$$
\begin{aligned}
\int_\mathbb{R} \frac{\partial}{\partial x_i} [\bar \psi^2  \frac{\partial}{\partial x_i}(\frac{\sum_{j \neq i} x_j \frac{\partial \psi}{\partial x_j}}{\bar \psi})] \ dx_i & = \lim _{\epsilon \to \infty} \int_{-\epsilon} ^{\epsilon} \frac{\partial}{\partial x_i} [\bar \psi^2  \frac{\partial}{\partial x_i}(\frac{\sum_{j \neq i} x_j \frac{\partial \psi}{\partial x_j}}{\bar \psi})] \ dx_i \\
& = \lim _{\epsilon \to \infty} \  \bar \psi^2  \frac{\partial}{\partial x_i}(\frac{\sum_{j \neq i} x_j \frac{\partial \psi}{\partial x_j}}{\bar \psi}) \ \ \  | _{-\epsilon} ^{\epsilon} \\ 
& = \lim _{\epsilon \to \infty} \  \bar \psi^2   (\sum_{j \neq i} x_j) (\frac{ \frac{\partial^2 \psi}{\partial x_i \partial x_j}\bar \psi - \frac{\partial \psi}{\partial x_i } \frac{\partial \bar \psi}{\partial x_j  }}{\bar \psi ^2}) \ \ \  | _{-\epsilon} ^{\epsilon} \\
& = \lim _{\epsilon \to \infty} \ (\sum_{j \neq i} x_j)  [\frac{\partial^2 \psi}{\partial x_i \partial x_j }\bar \psi - \frac{\partial \psi}{\partial x_i } \frac{\partial \bar \psi}{\partial x_j  }] \ \ \  | _{-\epsilon} ^{\epsilon} \\
\end{aligned} 
$$
where in the second equality we used the fundamental theorem of calculus to link the integration to values of some quantity at the "boundaries". For this to be zero we need: $\lim _{x_i \to \infty} \frac{\partial \psi}{\partial x_i} = 0 \ \forall i$.
I assumed that $j \neq i$ just to simplify calculations but extension to the case $i=j$ should be straightforward.
A: The following discussion builds on the

PS: if this helps, we can also discuss $∑_iA$ instead of $A$ alone.

If we take this sum, we see that we get a sum of first derivatives, which is  a divergence $\operatorname{div}$ of a vector field. This vector field is obtained by replacing the partial derivative in the square brackets with the gradient operator $\nabla$.
$$
\begin{aligned}
\sum_i A
&= \sum_i\frac{\partial}{\partial x_i}\left[\bar\psi^2\frac{\partial}{\partial x_i}\left(\frac{\sum_jx_j\left(\frac{\partial \psi}{\partial x_j}\right)}{\bar \psi}\right)\right]\\
&=\operatorname{div}\left(\bar\psi^2\nabla\left(\frac{\sum_jx_j\left(\frac{\partial \psi}{\partial x_j}\right)}{\bar \psi}\right)\right)
\end{aligned}
$$
Furthermore, $\sum_jx_j\left(\frac{\partial \psi}{\partial x_j}\right)$ is the scalar product of $\mathbf{x}$ and $\nabla\psi$:
$$
\begin{aligned}
\sum_i A
&= \operatorname{div}\left(\bar\psi^2\nabla\left(\frac{\mathbf{x}\cdot\nabla\Psi}{\bar \psi}\right)\right)\\
&=
\operatorname{div}\left(\bar\psi^2\frac{\bar{\psi}\nabla\left(\mathbf{x}\cdot\nabla\psi\right)-(\mathbf{x}\cdot\nabla\psi)\nabla\bar{\psi}}{\bar \psi^2}\right)\\
&= \operatorname{div}(\bar{\psi}\nabla\left(\mathbf{x}\cdot\nabla\psi\right))
-\operatorname{div}((\mathbf{x}\cdot\nabla\psi)\nabla\bar{\psi})
\end{aligned}
$$
Now, we can integrate the sum over a domain $D$ and apply the divergence theorem to obtain two surface integrals:
$$
\int_D\sum_i A\mathrm{d}\tau=\oint_S\bar{\psi}\nabla\left(\mathbf{x}\cdot\nabla\psi\right)\cdot\mathbf{n}\mathrm{d}S-\oint_S(\mathbf{x}\cdot\nabla\psi)\nabla\bar{\psi}\cdot\mathbf{n}\mathrm{d}S
$$
We see immediately, that for $D=\mathbb{R}^n$, this becomes zero since $\bar\psi=0$ and $\nabla\bar\psi=\mathbf{0}$ at the 'surface'.
This is a follow-up question.
