What is the most general expression for the coordinate representation of momentum operator? I have a question about deriving the coordinate representation of momentum operator from the canonical commutation relation, $$[x,p]= i.$$
One derivation (ref W. Greiner's Quantum Mechanics: An Introduction, 4th edi, p442) is as following:
$$ \langle x|[x,p]|y \rangle = \langle x|xp-px|y \rangle = (x-y) \langle x|p|y \rangle. $$
On the other hand,  $ \langle x|[x,p]|y \rangle = i \langle x|y \rangle = i \delta (x-y)$. Thus
$$ (x-y) \langle x|p|y \rangle = i \delta(x-y). \tag{1} $$
We use $(x-y) \delta(x-y) = 0$. Take the derivative with respect to $x$; we have $\delta(x-y) + (x-y) \delta'(x-y) = 0$. Thus
$$ (x-y) \delta'(x-y) = - \delta(x-y). \tag{2} $$
Comparing Eqs. (1) and (2), we identify
$$ \langle x|p|y \rangle = -i \delta'(x-y). \tag{3} $$
In addition, we can add $\alpha \delta(x-y)$ on the right-hand side of Eq. (3), i.e.
$$ \langle x|p|y \rangle = -i \delta'(x-y)  + \alpha \delta(x-y), $$
and $[x,p] = i$ is still satisfied. We can also add
$$ \frac{\beta}{\sqrt{|x-y|}}\delta(x-y)$$
on the RHS of Eq. (3).  Here $\alpha$ and $\beta$ are two real numbers.
My question is, what is the most general expression of $\langle x|p|y \rangle$? Can we always absorb the additional term into a phase factor like Dirac's quantum mechanics book did?
 A: We start by mentioning a couple of standard formulas
$$ \psi(x)~=~\langle x | \psi \rangle, \tag{1}$$
and
$$ \langle x | y \rangle ~=~\delta(x-y).\tag{2}$$
The canonical commutation relation (CCR) is
$$ [\hat{x}, \hat{p}] ~=~i\hbar{\bf 1}.\tag{3}$$
The standard Schrödinger position representation reads
$$\begin{align} \hat{x}~=~&x, \cr 
\hat{p}~=~&-i\hbar\frac{\partial}{\partial x}.\end{align}\tag{4}$$
We may conjugate the standard Schrödinger position representation (4) by an unitary operator $\hat{U}=e^{-if(\hat{x})}$, where $f:\mathbb{R}\to\mathbb{R}$ is a given differentiable function. In this way we obtain an unitary equivalent position representation
$$\begin{align}\hat{x}~=~&x, \cr 
\hat{p}
~=~&-i\hbar e^{-if(x)}\frac{\partial}{\partial x}e^{if(x)}\cr
~=~&-i\hbar\frac{\partial}{\partial x}+ \hbar f^{\prime}(x),\end{align}\tag{5}$$
of the CCR (3). The standard Schrödinger position representation (4) corresponds to $f\equiv {\rm const}$. For a general irreducible representation of the CCR (3), see the Stone-von Neumann theorem.
The representation (5) implies
$$\begin{align} \langle x | \hat{p} |\psi \rangle~=~&(\hat {p} \psi)(x)\cr
~=~&-i\hbar e^{-if(x)}(e^{if}\psi)^{\prime}(x)\cr
~=~&-i\hbar\psi^{\prime}(x)+ \hbar f^{\prime}(x)\psi(x). \end{align}\tag{6} $$
From (6) we conclude that the momentum matrix elements reads
$$ \langle x | \hat{p} |y \rangle~=~-i\hbar\delta^{\prime}(x-y)+ \hbar f^{\prime}(x)\delta(x-y)\tag{7}$$
in the representation (5).
Finally, here and here are two other Phys.SE posts that also discuss ambiguities in $x\leftrightarrow p$ overlaps.
A: In units $\hbar=1$, from $ \langle p|p' \rangle = \delta(p-p')$ and $\langle x|p \rangle  = \frac {1}{\sqrt{2 \pi}}e^{i px}$, you get  :
$\langle x|\hat p|y \rangle = \int_{|p>,|p'>} \langle x|p\rangle \langle p|\hat p|p'\rangle \langle p'|y\rangle = \frac {1}{2 \pi} \int_{|p>,|p'>} e^{ipx} p' \langle p|p' \rangle e^{-ip'y}$ 
$= \frac {1}{2 \pi} \int dp~ p ~e^{ip(x-y)} = - i\partial_x \frac {1}{2 \pi}\int dp~ e^{ip (x - y)} =  -i\delta'(x-y)$
