# Expectation value for a complex exponential in a harmonic oscillator

The question is: Show that for the Harmonic Oscillator, $$\langle0|e^{ikx}|0\rangle~=~e^{-\frac{k^2}{2}\langle0|x^2|0\rangle}.$$

My attempt at a solution uses coherent states: $$\langle0|e^{ikx}|0\rangle=\langle0|e^{ik\frac{(a+a^{\dagger})}{\sqrt{2}}}|0\rangle=$$

$$\langle0|e^{ika}e^{ika^{\dagger}}e^{\frac{-k^2[a,a^{\dagger}]}{2}}|0\rangle=$$

$$e^{\frac{-k^2}{2}}\langle0|e^{-\alpha^* a}e^{\alpha a^{\dagger}}|0\rangle$$

Defining the coherent state $\beta\rangle=e^{\frac{ika^{\dagger}}{\sqrt{2}}}$ which means that the associated bra would be $\langle\beta|=e^{\frac{-ika}{\sqrt{2}}}$ where a is still the lowering operator. the equation above reduces to $\langle-\beta|\beta\rangle$, which, using the formula for inner products of coherent states, I get $$\langle-\beta|\beta\rangle=e^{-\frac{|(-\beta^*)}{2}^2|-\frac{|\beta|^2}{2}+(-\beta^*\beta)}=e^{-|\beta|^2}$$

Therefore, I get for my final expectation value: $e^{\frac{k^2}{2}}$

Could someone point out what I did wrong? Since these clearly do not equal. Just as an experiment, I calculated what the expectation value of $x^2$ should be in the 0 state, and I got $\frac{i}{2}$, which still makes no sense.

I am not entirely sure what you mean with the definition of a coherent state since $e^{ika^\dagger}$ is an operator not a state, but the proof works without it. Also, you didn't define what the coefficients $\alpha$ are in the third step of your calculation.
In the second step, where you used the Baker-Campbell-Hausdorff formula you also missed a minus sign, since one negative sign comes from $i^2$, while one comes from the formula itself, such that $$e^{ik(a+a^\dagger)} = e^{ika} e^{ika^\dagger} e^{k^2[a,a^\dagger]/2}.$$ This means your expectation value is actually $$\langle 0|e^{ikx}|0\rangle = e^{k^2/2}\langle0|e^{ika}e^{ika^\dagger}|0\rangle.$$ You may then use the exponential series, i.e. $e^{x} = \sum_n x^n/n!$, so you end up with $$\langle 0|e^{ikx}|0\rangle = e^{k^2/2}\sum_{n,m}\frac{1}{n!}\frac{1}{m!}(ik)^n(ik)^m\langle0|a^n(a^\dagger)^m|0\rangle.$$ From there, things are pretty straightforward. You just need to show that you require $m=n$ so then you can compute the expectation value.
It might also be worth noting that $$\langle0|x^2|0\rangle = \langle0|(a+a^\dagger)^2|0\rangle = 1.$$
Remark: I dropped all factors in $x$ during my calculations, i.e. I used $x=(a + a^\dagger)$. Obviously, using the right definition of $x$ will change the result, but only by some factor.