What is the expectation value of the position times momentum operator? Should I write the expectation of the position times momentum operator as:
$$\langle xp\rangle = \langle \psi|x (-i\hbar \partial_x) |\psi \rangle$$
or
$$\langle xp\rangle = \langle \psi| (-i\hbar \partial_x x) |\psi\rangle$$
 A: In fact $xp$ is not self-adjoint, it can have non-real expectation values. But its symmetrized form $D=(1/2)(xp+px)$ is better behaved (it has a self-adjoint extension). It is the generator of dilatations which scales momenta and coordinates. The  complexification of ${\exp}[iDa]$ (i.e. $a$ becomes complex) is important for the study of the spectrum of a class of Schrödinger operators.
A: in short the first way, but you can see this via using the position basis,
$$
<x|\psi> = \psi(x) , \ 1 = \int |x><x| \ dx, \ p|x> = |x> (-i \hbar \partial_x), \ <x|x'> =\delta(x-x') \ \rightarrow \\
<\psi|xp|\psi> = \int dx \ dx' <\psi|x><x| x p | x'><x'|\psi> = \int dx \ dx' \psi^*(x) x <x|p | x'> \psi(x') \\
=\int dx \ dx' \psi^*(x) x <x|x'>(-i \hbar \partial_{x'}) \psi(x') = -i \hbar \int dx \ dx' \psi^*(x) x \ \delta(x-x')\partial_{x'}\psi(x') \\
= -i \hbar \int dx \  \psi^*(x) \ (x \ \partial_{x}\psi(x) ) = <xp>_\psi
$$
typically you don't have to be this explicit but hopefully this helps. If this is a bit too much you can find more information in many introductory texts to QM such as Sakurai. Hope this helps
