here is my question:
Im trying to find the matrix elements of the momentum operator $\hat{P}$ in the position basis $|x\rangle$:
$$\langle x|\hat{P}|x'\rangle := \langle x|\hat{P}\int dp|p\rangle \langle p|x'\rangle=\langle x|\hat{P}\int dp|p\rangle \frac{1}{\sqrt {2\pi}}e^{-ipx'}$$
where $\hbar=1$. Now acting $\hat{P}$ on the ket $|p\rangle$ and multiplying by the bra $\langle x|$:
$$\tag{1}\langle x|\hat{P}|x'\rangle :=\frac{1}{2\pi}\int dp\space p e^{ip(x-x')}$$
so according to some texts (and remembering QM lessons) the matrix elements should be: $$\tag{2}\langle x|\hat{P}|x'\rangle:=-i\frac{d}{dx}\delta(x-x')$$
so if im not wrong this should mean that (1) its equal to (2). Are these calculations right? How is the integral equal to the expression (2)? Does someone knows some book where they develop the momentum operator in the x basis formally?