Help With Contour Integral Could you please help solving the following integral,
\begin{equation}
\int_{-\infty}^{\infty}{d\omega  \frac{\gamma (\gamma+2i\omega)}{(\gamma-2i\omega)^3}} e^{-i\omega t}
\end{equation}
I could solve it analytically in mathematica but the solution isn't very intelligible.
Thank you
 A: First, we rewrite the integral slightly.
\begin{align}
I:&=\int_{-\infty}^\infty d\omega\frac{\gamma(\gamma + 2i\omega)}{(\gamma-2i\omega)^3}e^{-i\omega t}\\
&=\int_{-\infty}^\infty d\omega\frac{\gamma(\gamma + 2i\omega)}{-8i^3\left(\omega - \frac{\gamma}{2i}\right)^3}e^{-i\omega t}\\
&=\int_{-\infty}^\infty d\omega\frac{\gamma(\gamma + 2i\omega)}{8i\left(\omega+i\frac{\gamma}{2}\right)^3}e^{-i\omega t}\\
&=-\frac{i}{8}\int_{-\infty}^\infty d\omega\frac{\gamma(\gamma + 2i\omega)}{\left(\omega+i\frac{\gamma}{2}\right)^3}e^{-i\omega t}\\
&=-\frac{i}{4}\int_{-\infty}^\infty d\omega\frac{\alpha(\alpha+i\omega)}{(\omega + i\alpha)^3}e^{-i\omega t}\\
&=\frac{1}{4}\int_{-\infty}^\infty d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} \tag1
\end{align}
where I have set $\alpha = \frac{\gamma}{2}$ in the last step for simplicity's sake.
We want to turn this into a contour integral so that we can use the residue theorem. The easiest contour would be one of which the integral along the real axis is a part of, where the integrals along the other parts of the contour evaluate to $0$.
To do this, first consider the case that $t<0$.
Let $\Gamma$ be a contour that runs along the real axis from $-R$ to $R$ and is then closed along the arc of a semi-circle of radius $R$, centred at the origin, in the upper half plane.
Then
\begin{align}
\oint_\Gamma dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t}=\int_{-R}^R d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} + \int_\text{Arc} dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t} \tag2
\end{align}
We can calculate the integral on the LHS of $(2)$ using the Residue Theorem easily - as the integrand has no poles in the upper half plane, it simply evaluates to $0$.
As we take the limit $R\rightarrow\infty$, the positive imaginary part of $z$ along the semi-circle arc ensures that the second integral of the RHS of $(2)$ goes to $0$.
Thus, for $t<0$, we have
\begin{align}
\int_{-\infty}^\infty d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} = 0 \tag3
\end{align}
Now let $t>0$.
Let $\Psi$ now be a contour along the real axis from $-R$ to $R$ so that $|R|>\alpha$ and then closed along the arc of a semi-circle of radius $R$, centred at the origin, in the lower half plane.
Since this contour is now traversed in clockwise direction, we have
\begin{align}
-\oint_\Psi dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t}=\int_{-R}^R d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} + \int_\text{Arc} dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t} \tag4
\end{align}
By the Residue Theorem, we have
\begin{align}
\oint_\Psi dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t}&=2\pi i \text{Res}(f,-i\alpha)\\
&=\alpha\pi i\lim\limits_{z\rightarrow -i\alpha}\frac{d^2}{dz^2}\left[(z-i\alpha)e^{-izt}\right]\\
&=\alpha\pi i\lim\limits_{z\rightarrow -i\alpha}ite^{-izt}(\alpha t + itz -2)\\
&=-2\alpha\pi te^{-\alpha t}(\alpha t - 1)
\end{align}
Plugging this into $(4)$, we obtain
\begin{align}
2\alpha\pi te^{-\alpha t}(\alpha t - 1) = \int_{-R}^R d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} + \int_\text{Arc} dz\frac{\alpha(z-i\alpha)}{(z + i\alpha)^3}e^{-iz t} \tag5
\end{align}
As we take the limit as $R\rightarrow\infty$, the integral along the semi-circle arc goes to zero (see the argument above).
Thus, for $t>0$, we have
\begin{align}
\int_{-\infty}^\infty d\omega\frac{\alpha(\omega-i\alpha)}{(\omega + i\alpha)^3}e^{-i\omega t} = 2\alpha\pi te^{-\alpha t}(\alpha t - 1) \tag6
\end{align}
Putting these two results together and plugging $\gamma$ back in to get the answer in terms of the original variables, we have the final result
\begin{align}
\int_{-\infty}^\infty d\omega\frac{\gamma(\gamma + 2i\omega)}{(\gamma-2i\omega)^3}e^{-i\omega t} = \frac{\pi\gamma}{4}\theta(t)te^{-\frac{\gamma}{2}t}\left(\frac{\gamma}{2}t - 1\right) \tag7
\end{align}
where $\theta(t)$ is the Heaviside step function.
