Correlation Function of One-Dimensional XY Model From the Harvard lecture notes XY model:  particle-vortex duality by Subir Sachdev, the path-integral of 1D XY-model is given by 
$$\mathcal{Z}=\int\mathcal{D}\theta\exp{\left\{-\frac{K}{2}\int \!dx~(\frac{d\theta}{dx})^{2}\right\}}.\tag{4}$$
Introducing a complex order parameter $$\psi=e^{i\theta},\tag{3}$$ the correlation function is given by
$$\left\langle\psi(x)\psi^{\ast}(0)\right\rangle=\exp{\left(-\frac{1}{K}\int\!\frac{dk}{2\pi}\frac{1-\cos(kx)}{k^{2}}\right)}.\tag{5}$$
My question is how I should perform the path-integral to obtain the above correlation function?
 A: To answer this question we will first find the correlator:
$$\langle e^{i\alpha \theta(x)} e^{-i\alpha \theta(0)}\rangle=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{-\int dx\frac{K}{2} \left( \frac{d\theta}{dx}\right)^2+i\alpha \theta(x)-i\alpha\theta(0) \right\}$$
Take the Fourier Transform: 
$$\langle e^{i\alpha \theta(x)} e^{i\alpha' \theta(0)}\rangle=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{\int \frac{d^D k}{(2\pi)^D}\left(-\frac{K}{2} k^2 \theta(k)\theta(-k)+i\alpha \theta(k)e^{ikx}-i\alpha\theta(k) \right)\right\}$$
$$\langle e^{i\alpha \theta(x)} e^{i\alpha' \theta(0)}\rangle=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{\int \frac{d^D k}{(2\pi)^D}\left(-\frac{K}{2} k^2 \theta(k)\theta(-k)+2\alpha \theta(k)e^{ikx/2} \sin \left(\frac{kx}{2}\right)\right)\right\}$$
$$=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{\int \frac{d^D k}{(2\pi)^D}\left(-\frac{K}{2} k^2 \theta(k)\theta(-k)+\alpha \theta(k)e^{ikx/2} \sin \left(\frac{kx}{2}\right)+\alpha \theta(-k)e^{-ikx/2} \sin \left(-\frac{kx}{2}\right)\right)\right\}$$
Complete the square:
$$\langle e^{i\alpha \theta(x)} e^{i\alpha' \theta(0)}\rangle=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{\int \frac{d^D k}{(2\pi)^D}\left(-\frac{K}{2} k^2 \left(\theta(k)+\frac{2}{K k^2}\alpha e^{-ikx/2} \sin\left( -\frac{kx}{2}\right) \right) \left(\theta(-k)+\frac{2}{K k^2}\alpha e^{ikx/2} \sin\left( \frac{kx}{2}\right) \right)-\frac{2\alpha^2}{Kk^2} \sin^2\left(\frac{kx}{2}\right)\right)\right\}$$
Redefining the fields so that:
$$\theta(k)\rightarrow \theta(k)+\frac{2}{K k^2}\alpha e^{-ikx/2} \sin\left( -\frac{kx}{2}\right)$$
we get
$$\langle e^{i\alpha \theta(x)} e^{i\alpha' \theta(0)}\rangle=\frac{1}{\mathcal{Z}}\int \mathcal{D}\theta \exp\left\{\int \frac{d^D k}{(2\pi)^D}\left(-\frac{K}{2} k^2 \theta(k) \theta(-k)-\frac{2\alpha^2}{Kk^2} \sin^2\left(\frac{kx}{2}\right)\right)\right\}$$
$$=\exp\left\{-\int \frac{d^D k}{(2\pi)^D} \frac{2\alpha^2}{Kk^2} \sin^2\left(\frac{kx}{2}\right)\right\}\frac{\mathcal{Z}}{\mathcal{Z}}$$
$$=\exp\left\{-\int \frac{d^D k}{(2\pi)^D} \frac{\alpha^2}{Kk^2} (1-\cos\left(kx\right))\right\}$$
which setting $D=1$ and $\alpha=1$ gives you your answer. (you could set $\alpha=1$ initially - I didn't as I thought it may help in the derivation. p.s. sorry for the long equations.
A: It seems that we can also use a trick in Xiao-Gang Wen's book (Quantum field theory of many body systems, page 93).
Now $\mathcal{L}=\frac{K}{2\pi}(\partial_x\theta)^2$, then the correlation function (in imaginary time) is
$$\langle e^{i\theta(x_1)}e^{-i\theta(0)}\rangle=\frac{\int D\theta(x)e^{-\int dx\frac{K}{2\pi}(\partial_x\theta)^2+\int dx f(x)\theta(x)}}{\int D\theta(x)e^{-\int dx\frac{K}{2\pi}(\partial_x\theta)^2}}=e^{\frac{1}{2}\int dxdy\,f(x)G(x-y)f(y)},$$
where $f(x)=\delta(x-x_1)-\delta(x)$, and $G(x-y)=(-\frac{K}{\pi}\partial_x^2)^{-1}$.
$$\frac{1}{2}\int dxdy\,f(x)G(x-y)f(y)=G(0)-G(x_1)=-\int\frac{dk}{2\pi}\frac{\pi}{K}\frac{1-e^{ikx}}{k^2},$$ and $\int dke^{ikx}/k^2$ can be further simplified to $\int dk \cos(kx)/k^2$. And also, this method can be generalized to D dimension, which is the same as Quantum spaghettification, but here we do not need the re-definition procedure.
