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.
The following discussion builds on the
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.