What is $\langle x_1 |\hat V(\hat x)| x_2 \rangle$? So I've become rusty in Quantum Mechanics.  What is $\langle  x_1 |V(\hat x)| x_2 \rangle$? Where $V$ is the potential and $|x \rangle$ is the postion eigenket?
$$ \langle  x_1 |\hat V(\hat x)| x_2 \rangle = ? $$
Is it with $V(x_1) \delta(x_1 -x_2)$ but since the position operator can also act on a bra is it $V(x_2) \delta(x_1 -x_2)$ or some combination of $x_1$, $x_2$ like $V(x_1,x_2) \delta(x_1 -x_2)$? If it does not make any difference can you prove so? ( I was doing a calculation where it seemed to make a difference).
Thanks
Calculation where is matters
The following is a snippet of what I was doing.
Let the Hamiltonian $\hat H$ of the particle be:
\begin{equation}
    \hat H = \hat T + \hat V
\end{equation}
where $\hat T$ is the kinetic energy and $\hat V$ is the potential energy. Now, to find the velocity:
\begin{equation}
    \hat v = \frac{-i}{\hbar}[\hat H , \hat x] = \frac{-i}{\hbar} [ \hat T , \hat x] = \hat T'(\hat p)
\end{equation}
where $\hat T'(\hat p)$ is the velocity which is a function of momentum. Now, if we further assume $T'(p)$ is of degree $1$ and find the acceleration $\hat a$:
\begin{equation}
    \hat a = \frac{-i}{\hbar} [ \hat H ,  \hat T'(\hat p) ] =\frac{-i}{\hbar}  [\hat V,\hat T'( \hat p )] = \hat a (\hat x) 
\end{equation}
We know that acceleration must be a function of $\hat x$ since we have already assumed $T'(p)$ is of degree $1$ and find the acceleration $\hat a$.
Hence,
\begin{equation}
 [\hat a, \hat x] = 0    
\end{equation}
Now, multiplying $| x \rangle$ on the $\hat a$ equation:
\begin{equation}
  \langle x ' |  \hat a  | x \rangle =   \langle x ' | [\hat V,\hat T'( \hat p )]  | x \rangle
\end{equation}
Using the eigenvalue equation with eigenvalue $a$ (which represents the acceleration at a position $| x \rangle $ ):
\begin{equation}
     a  \langle x ' | x \rangle= a \delta( x' - x) = \frac{-i}{\hbar}  \langle x ' | (\hat V \hat T'( \hat p ) - \hat T'( \hat p ) \hat V)  | x \rangle = \frac{-i}{\hbar}  (V(x') - V(x)) \langle x' | \hat T'( \hat p ) | x \rangle
\end{equation}
Dividing both:
\begin{equation}
     \frac{i \hbar a}{(V(x') - V(x)) }  \delta( x' - x) = \langle x' | \hat T'( \hat p ) | x \rangle
\end{equation}
Let us consider $\langle x' | \hat T'( \hat p ) | \psi \rangle$:
\begin{equation}
    \langle x' | \hat T'( \hat p ) | \psi \rangle = \int_{-\infty}^\infty \langle x' | \hat T'( \hat p ) | x \rangle \langle x| \psi \rangle dx = \int_{- \infty}^\infty \frac{i \hbar a}{(V(x') - V(x)) }  \delta( x' - x) \psi(x)dx
\end{equation}
Or:
\begin{equation}
    \langle x' | \hat v | \psi \rangle = \int_{- \infty}^\infty \frac{i \hbar a}{(V(x') - V(x)) }  \delta( x' - x) \psi(x) dx
\end{equation}
Due to the quantization condition of position and momentum:
\begin{equation}
        \frac{- i \hbar}{m }\frac{\partial }{ \partial x'} \psi (x') = \int_{- \infty}^\infty \frac{ a i \hbar}{(V(x') - V(x)) }  \delta( x' - x) \psi(x) dx
\end{equation}
OR:
\begin{equation}
        \frac{\partial }{ \partial x'} \psi (x') = \int_{- \infty}^\infty \frac{ - m a }{(V(x') - V(x)) }  \delta( x' - x) \psi(x) dx
\end{equation}
Let us now try $V(x) = - G \frac{m M}{x}$ (point particle potential):
\begin{equation}
        \frac{\partial }{ \partial x '} \psi (x') = \int_{- \infty}^\infty \frac{- a}{(-\frac{GM}{x'} + \frac{GM}{x}) }  \delta( x' - x) \psi(x) dx
\end{equation}
Simplifying:
\begin{equation}
      GM  \frac{\partial }{ \partial x '} \psi (x') = \int_{- \infty}^\infty \frac{ a x x'}{(x' - x) }  \delta( x' - x) \psi(x) dx
\end{equation}
Again Taylor expanding around $\psi (x)$ around $x'$:
\begin{equation}
      GM  \frac{\partial }{ \partial x '} \psi (x') = \int_{- \infty}^\infty \frac{ a x x'}{(x' - x) }  \delta( x' - x) (\psi(x') + (x-x') \partial_{x'} \psi(x') + \dots) dx
\end{equation}
Plugging in the ansatz $a = - \frac{GM}{x x'}$ we get:
\begin{equation}
      GM  \frac{\partial }{ \partial x '} \psi (x') = \int_{- \infty}^\infty - \frac{ GM}{(x' - x) }  \delta( x' - x) (\psi(x') + (x-x') \partial_{x'} \psi(x') + \dots) dx
\end{equation}
Note the term $\int_{- \infty}^\infty \frac{ GM}{(x' - x) }  \delta( x' - x) \psi(x') $ goes to $0$ since is antisymmetric.
\begin{equation}
    GM  \frac{\partial }{ \partial x '} \psi (x') =  GM  \frac{\partial }{ \partial x '} \psi (x')
\end{equation}
Hence, we get a consist solution which agrees with classical calculations.
Note: $a = - GM{x^{-2}}$ or $a = - GM{x'^{-2}}$ both will give wrong answers.
 A: I'm not very good at the rigorous math, but the way I think about it is that "functions" like the Dirac Delta are actually distributions, meaning that they only make sense inside of an integral of the form:
$$\int_{a}^b \text{d}x\,\,f(x)\delta(x),$$
where $f(x)$ is a well-behaved (smooth, with a compact support over the interval, etc.) test function.
The quantity that you are talking about is also a distribution (it's just the product of the delta-function with the potential) and so it too must be defined in a similar way. However, it's pretty easy to show that:
$$\int_{a}^b \text{d}x_1\,\,f(x_1) V(x_1)\delta(x_1 -x_2) = \int_{a}^b\text{d}x_2\,\, f(x_2) V(x_2)\delta(x_1-x_2),$$
using a simple substitution of variables. As a result, both your answers are essentially equal, in the sense that their distributions are equal.
As to your example, there are many assumptions there that might be justified, but which I don't quite understand. However, there are some steps that I am uncomfortable with: for example, consider the step where you divide by $V(x')-V(x)$. The term on the left hand side is proportional to: $$\frac{\delta(x'-x)}{V(x')-V(x)},$$ and I suspect there are many problems with this. For starters, you will be dividing by zero when $V(x')=V(x)$, and more importantly, you cannot multiply distributions by singular functions, as the result would not be a well defined distribution.
A: You can think of it in the sense of distributions, and then Philip's answer applies, in the sense that, as distributions
$$ f(x)\delta(x-y)=f(y)\delta(x-y)$$
but more intuitively, you can also think of $\delta(x-y)$ as having support only on $x=y$ meaning that it is equal to $0$ for all $x\neq  y$ (this is not mathematically rigorous, but it works on an intuitive level), so the only point where $V(x_1)\delta(x_1-x_2)$ does not vanish is $x_1=x_2$, so you can put either of them in the potential. In fact you can think of
$$ V(x_1)\delta(x_1-x_2)=V(x_2)\delta(x_1-x_2)$$
as the continuous equivalent of
$$ \delta_{ij} V_j=\delta_{ij}V_i$$
where $\delta_{ij}=1$ if $i=j$ and $0$ otherwise and $V$ is a vector. It doesn't matter whether you take $V_i$ or $V_j$, since in all cases where the above expression is not $0=0$, $i=j$.
A: To add on to the other answers, if $V(x)$ is function of a real variable, then $\hat{V}$ really means
$$
\hat{V} = \int_{-\infty}^{\infty} V(x) | x \rangle \langle x | \mathrm{d} x
$$
where $| x \rangle$ is the same position eigenket as your definition
$$
\hat{x} | x \rangle = x | x \rangle
$$
You can verify that
$$
\hat{V} |x \rangle = V(x) |x \rangle
$$
And so yes, the answer to your first question is
\begin{align}
\langle x_1 | \hat{V} |x_2 \rangle = V(x_2) \langle x_1 |x_2 \rangle &= V(x_2) \delta(x_2 - x_1) \\
&= V(x_1) \delta(x_2 - x_1)
\end{align}
