Mathematical confusion in quantum mechanics During a class about Ehrenfest theorem, my teacher use an equation to proceed its derivation (to prove $\frac{d<r>}{dt}=\frac{<p>}{m}$ ) and that is:
$$\int{x\psi\nabla^2\psi^*}d\tau=\int{\psi^*\nabla^2(x\psi)}d\tau$$
and the explanation provided by him is that $\psi\rightarrow 0$ as $x\rightarrow\infty$ .
And also in the second part ( to prove $\partial_t{<p_x>}=-\partial_x{V}$ ) he wrote,
$$\int\left[\frac{\partial^2\psi}{\partial{x^2}}\frac{\partial\psi}{\partial{x}}-\psi^*\frac{\partial^3\psi}{\partial{x^3}}\right]dx=0$$
here also he provide same explanation. But I think if this were the case, then the integral $\int\psi\psi^*d\tau$ must be equal to zero because $\psi\rightarrow{0}$ as $x\rightarrow\infty$. But it is equal to one, as it is the total probability. Then how the above two equations came? 
Is there any conceptual misunderstanding in my knowledge?
 A: *

*$\int{x\psi\nabla^2\psi^*}d\tau=\int{\psi^*\nabla^2(x\psi)}d\tau$??


$\int{x\psi\nabla^2\psi^*}d\tau=\int x\psi (\frac{\partial^2}{\partial x^2}+\frac{\partial^2}{\partial y^2}+\frac{\partial^2}{\partial z^2})\psi^* dxdydz$
$\int x\psi \frac{\partial^2}{\partial x^2}\psi^* dx=x\psi (\psi^*)'|^{\infty}_{-\infty}-\int (\psi+x \psi')(\psi^*)'dx=-(\psi+x\psi')\psi^*|_{interval}+\int(\psi'+\psi'+x\psi'')\psi^* dx=\int \psi^* \frac{\partial^2}{\partial x^2}(x\psi)dx $
using $\psi\rightarrow 0$ as $x\rightarrow \infty, -\infty$ and then
$\int x\psi \frac{\partial^2}{\partial x^2}\psi^* dxdydz =\int \psi^* \frac{\partial^2}{\partial x^2}(x\psi)dxdydz$
In the same manner or intuitively you can see that 
$\int x\psi \frac{\partial^2}{\partial y^2}\psi^* dydzdx =\int \psi^* \frac{\partial^2}{\partial y^2}(x\psi)dydzdx$
$\int x\psi \frac{\partial^2}{\partial z^2}\psi^* dzdydx =\int \psi^* \frac{\partial^2}{\partial z^2}(x\psi)dzdydx$
This proves $\int{x\psi\nabla^2\psi^*}d\tau=\int{\psi^*\nabla^2(x\psi)}d\tau$.


*$\int\left[\frac{\partial^2\psi}{\partial{x^2}}\frac{\partial\psi}{\partial{x}}-\psi^*\frac{\partial^3\psi}{\partial{x^3}}\right]dx=0$??


You can go in the same manner, i.e. integrating by parts... $\int\frac{\partial^2\psi}{\partial{x^2}}\frac{\partial\psi}{\partial{x}}dx=\frac{1}{2}\psi'(x)^2|_{interval}$


*If $\psi\rightarrow 0$ as $x\rightarrow \infty$ then $\int\psi\psi^*d\tau$?


Consider $\psi=1/x$ and $\int^{\infty}_{0}1/x^2 \,dx \not= 0$.
A: Let's talk about 1d just to keep it as simple as possible. Consider the ground state of the simple harmonic oscillator. The energy eigenstates are each a Gaussian multiplied by a polynomial. The ground state is just a Gaussian.
So each of those states goes to zero as $x\rightarrow\pm\infty.$ And each of them is unit norm.
And any finite linear combination if them also goes to zero as $x\rightarrow\pm\infty.$ And so if you use integration by parts on any of them or on any finite linear combination of them you do get all the results you mentioned.
However in an infinite dimensional space it does not follow that $x\rightarrow\pm\infty$ for every state because there are also infinite linear combinations. So for instance you can make a state that is zero when $|x|>1$ and equals $a(1+x)^4(1-x)^4$ when $x\in[-1,1].$ And by adjusting $a$ we can make it so the area of the square is 1/2 and then we can make a squished version that has the area of the square of the squished version is 1/4 but it has the same height and make a third even more squished one where the area of the square of the squished version is 1/16 but it has the same height and so on. And if we take translated versions of these so they have their centers at 0, 10, 100, etc then you get a perfectly fine function that has a unit area for the square and yet doesn't have the function go to zero x goes to infinity. But only because I was taking infinite linear combinations.
So it simply is not the case that $x\rightarrow\pm\infty$ for an arbitrary wavefunction, and so integration by parts is not (all by itself) the reason you get these identities.
One approach is to replace the derivatives with weak derivatives, but then you have to learn about weak derivatives. Another is to focus on the equation you are trying to derive and subtract the two sides from each other (which assumes they are not infinite) and say you are trying to prove it is zero, in which case you succeed if you show it is less (in magnitude) than any positive epsilon so you pick an epsilon then you approximate everything well enough with finite linear combinations of these nice wavefunctions (where you can do interaction by parts and the boundary terms do vanish) so that you get the difference is less than epsilon.
In the example I gave you notice the stuff super far away can be eventually ignored if you are only trying to be accurate to within an epsilon.
