I am reviewing basic quantum mechanics since I feel like I am struggling with the fundamentals. I am not sure exactly how much I am "taking for granted" or whether or not my logic is clear.
My goal is (in 1-D) to get to $[\hat{x},\hat{p}] = i$ where I set $\hbar = 1$. For now I am taking $\langle x' | x \rangle = \delta(x'-x)$, and $\langle p|x \rangle = \frac{1}{\sqrt{2\pi}}\exp(ipx)$. That last identity I am not sure whether I am taking for granted or not.
In any case, what I have is
$$ \langle \psi | \hat{x}\hat{p} | \psi \rangle = \int dx'dp' \langle\psi|\hat{x}|x'\rangle\langle x'|\hat{p}|p'\rangle\langle p'|\psi\rangle = \int dx' dp'dx'' x'p' \frac{1}{\sqrt{2\pi}}\exp(-ix'p')\langle\psi|x'\rangle\langle p'|x''\rangle\langle x''|\psi\rangle \\ = \frac{1}{2\pi}\int dx'dp'dx'' x'p'e^{-ip'(x'-x'')}\langle\psi|x'\rangle \langle x''|\psi\rangle. $$ Then we have $$ \langle \psi | \hat{p}\hat{x} | \psi \rangle = \frac{1}{2\pi}\int dx'dp'dx'' x'p'e^{ip'(x'-x'')}\langle\psi|x''\rangle \langle x'|\psi\rangle. $$ So we then have $$ \langle\psi|[\hat{x},\hat{p}]|\psi\rangle = \frac{1}{2\pi}\cdot2\text{Im}\Big[\int dx'dp'dx''x'p'e^{-ip'(x'-x'')}\langle\psi|x'\rangle\langle x''|\psi\rangle\Big]. $$ The only way I see the canonical commutation relation hold is if the imaginary part of the integrand evaluates to $\pi$. Am I making a mistake somewhere? If not, is there a neat trick I cannot see?