Not sure if this maybe belongs more in the maths section, but since it comes from a physics problem i'll post here.
when calculating the natural broadening lineshape for a laser we have to take the fourier transform of the dipole E-field.
$E_w=\int_{-\infty}^\infty\vec{E}(0)e^{-\gamma{t}/2}\cos(\omega_0t)e^{i\omega{}t}u(t)dt$
where $u(t)$ is the Heaviside step function (basically take the integral from 0 to infinity)
if I evaluate the integral using $\cos(x)=\frac{1}{2}(e^ix+e^{-ix})$ then I get a messy
$E_w=\frac{\gamma/2-i\omega}{\omega_0^2-\omega^2+\gamma^2/4+i\omega\gamma}$
and when I take the mod squared to get the Intensity I don't get the Lorentzian lineshape. However I instead say that $\cos(x)=\Re(e^{ix})$ I get
$E_w=\Re[\frac{\vec{E}(0)e^{-i\phi}}{(\omega-\omega_0)^2+(\gamma/2)^2}]$
where $\tan\phi=\frac{\omega-\omega_0}{\gamma/2}$. Now taking the mod squared and the Lorentzian line shape is achieved! But firstly if I take the real component before taking the mod square then I'll end up with a $cos^2()$ term after mod squaring it right? Unless (as I suspect) I'm missing something. Also can anyone explain why the first method doesn't work?
I believe the issue is that the integral you are writing gives you two Lorentzian curves, one centered at $+\omega_0$ and the other at $-\omega_0$. You can see this by writing
$2E_\omega = \left[i(\omega-\omega_0) + \gamma/2\right]^{-1} + \left[i(\omega+\omega_0) + \gamma/2\right]^{-1}$
As long as our damping is small, $\gamma \ll\omega_0$ when we are near $\omega\sim\omega_0$ the second term is much smaller than the first term and we approximately $$|E_\omega|^2\approx |i(\omega-\omega_0) + \gamma/2|^{-2}= \frac{1}{(\omega-\omega_0)^2 +(\gamma/2)^2}$$.
So the intensity is roughly Lorentzian peaks at $\omega_0$ and $-\omega_0$.
If $\gamma$ is not much smaller than $\omega_0$, nothing interesting happens. The two peaks overlap and bleed into each and so don't look too Lorentzian anymore.