Our physics professor proved a special case of Ehrenfest's theorem, or to be more precise: $$m\langle x\rangle = \langle p\rangle,$$ where we have used the definition: $$\langle x\rangle = \int_{\mathbb{R}}\psi^* (x,t)\, x\,\psi(x,t)\, dx,$$ and $\psi$ is a normalized wave function.
In the proof at some point he writes the following: $$\begin{align}\begin{aligned} \imath \frac { \hbar } { 2 m } \int _ { \mathbb { R } } d x\, x\, \Psi ( x , t ) ^ { * } &\frac { \partial ^ { 2 } } { \partial x ^ { 2 } } \Psi ( x , t ) = \imath \frac { \hbar } { 2 m } \left[ x \Psi ( x , t ) ^ { * } \frac { \partial } { \partial x } \Psi ( x , t ) \right] _ { x = - \infty } ^ { x = \infty } \\ & - \imath \frac { \hbar } { 2 m } \int _ { \mathbb { R } } d x \left( \Psi ( x , t ) ^ { * } \frac { \partial } { \partial x } \Psi ( x , t ) + x \frac { \partial } { \partial x } \Psi ( x , t ) ^ { * } \frac { \partial } { \partial x } \Psi ( x , t ) \right). \end{aligned}\end{align}$$ I really don't understand how the integration by parts works here and would be really happy if someone could explain this.