Momentum operator in position representation and viceversa So I thought that
$$\hat{p}~=~-i\hbar \frac{\partial}{\partial x}~$$
and
$$\hat{x}~=~i\hbar \frac{\partial}{\partial p}~$$
but I have just encountered the next problem:
"Find the wave function for the fundamental state of
$$H = \frac{p^2}{2m}+\frac{1}{2}m\omega^2x^2$$
in the position base."
So they are asking me for: $\psi_0(x)= ⟨x|0⟩ $
I did as follows: I wanted to apply the condition:
$$a|0⟩ = 0$$
With $a$ being:
$$a=\sqrt{\frac{m\omega}{2\hbar}}(x+ip)$$
I figured that since
$$\hat{x}|x⟩=x|x⟩$$
and
$$\hat{p}|x⟩=-i\hbar \frac{\partial}{\partial x}|x⟩$$
I could just plug them in the equation for a and ended up with:
$$ \sqrt{\frac{m\omega}{2\hbar}} \bigg( x+\hbar \frac{\partial}{\partial x} \bigg) \psi_0 = 0$$
Which led me to:
$$\frac{d\psi_0}{\psi_0}=-\frac{x}{\hbar}dx$$
But checking the answers, they stated that:
$$\hat{p}|x⟩=\frac{-i\hbar}{\sqrt{m\omega\hbar}} \frac{\partial}{\partial x}|x⟩$$
And I don't understand where does the square root diving $-i\hbar$ is coming from.
 A: I think this is a problem between different notations.
First of all, indeed you have $ \widehat{x} \left |  \Psi \right > = x\left |  \Psi \right > $ and $ \widehat{p} \left |  \Psi \right > = -i\hbar\frac{\partial\left |  \Psi \right >}{\partial x} $. But the annihilation operator $\widehat{a}$ is equal to $\frac{\widehat{X}+i\widehat{P}}{\sqrt{2}}$ where $ \widehat{X}$ and $\widehat{P}$ are dimensionless operators.
And it happens that you have : $\widehat{X}=\sqrt{\frac{m\omega}{\hbar}}\widehat{x}$  and $\widehat{P} = \frac{\widehat{p}}{\sqrt{m\hbar \omega}}$ Hence the expression written in the answer where the $\widehat{p}$ should be interpreted as $\widehat{P}$ I guess.
And by the way if you use these expressions you will find that $\widehat{a}=\sqrt{\frac{m\omega}{2\hbar}}\left (\widehat{x}+\frac{i\widehat{p}}{m\omega} \right )$
A: Your annihilation operator is wrong. It is,
$$ a= (\sqrt{\frac{m\omega}{2}}x + i\frac{p}{\sqrt{2m\omega}})$$
To find $\langle{x'}|0⟩$ you just have to solve this equation:
$$ \langle{x'}|a|0⟩=0$$
$$ \langle{x'}|(\sqrt{\frac{m\omega}{2}}x + i\frac{p}{\sqrt{2m\omega}})|0⟩=0$$
Since $p=-i\partial_{x'}$,
$$\sqrt{\frac{m\omega}{2}}x'\langle{x'}|0⟩+\frac{\partial_{x'}\langle{x'}|0⟩}{\sqrt{2m\omega}}=0$$
On solving this differential equation you will get $\psi_0(x')$. To calculate any $\psi_n(x')$ just apply the creation operator n times on $|0⟩$ and take the inner product $⟨x'|n⟩$.
Note: I have used $\hbar =1$.
