I want to integrate
$$ \int_{-\infty}^{\infty} dw \hspace{0.51em}\frac{w^{n} e^{i wt}}{(w^{2}-\Omega^{2})^2 +(\gamma w)^2} $$
I did so using contour integration because it has the poles:
$$w=\mp \frac{i\gamma}{2} \pm \sqrt{\Omega^{2}-\frac{\gamma^{2}}{4}}$$
resulting in:
$$2^{1-n} i \pi \left(\frac{e^{-\frac{1}{2} \tau \left(\gamma +i \sqrt{4\Omega ^2-\gamma ^2}\right)} \left(-\sqrt{4 \Omega ^2-\gamma^2}+i \gamma \right)^n}{\gamma \left(\sqrt{4 \Omega ^2-\gamma^2}-i \gamma \right)+4 i \Omega ^2}-\frac{e^{\frac{1}{2} i \tau \left(\sqrt{4 \Omega ^2-\gamma ^2}+i \gamma \right)}\left(\sqrt{4 \Omega ^2-\gamma ^2}+i \gamma \right)^n}{\gamma \left(\sqrt{4 \Omega^2-\gamma ^2}+i \gamma \right)-4 i \Omega^2}\right)$$
I decided that I wanted to check with the numerical results because I hadn't done contour integration in a while, for that I did the following, I chose $ n = 3, \gamma = 3, \Omega = 4 $, and plotted for $ \tau $
f[n_, γ_, Ω_, τ_] := I 2^(1 - n) Pi((E^(-(1/2) τ (γ + I Sqrt[
-γ^2 + 4 Ω^2])) (I γ - Sqrt[-γ^2
+ 4 Ω^2])^n)/(4 I Ω^2 + γ (-I γ + Sqrt[-γ^2
+ 4 Ω^2])) - (E^(1/2 I τ (I γ + Sqrt[-γ^2 + 4 Ω^2]))
(I γ + Sqrt[-γ^2 + 4 Ω^2])^n)/(-4 I Ω^2 + γ
(I γ + Sqrt[-γ^2 + 4 Ω^2])))
Plot[f[3, 3, 4, τ], {τ, 0, 5}]
and then tried the same with numerical integration
int[n_, γ_, Ω_, τ_] := γ w^n Exp[I w τ]/((w^2 -
Ω^2)^2 + (γ w)^2)
fau[τ_] := NIntegrate[Im[int[3, 3, 4, τ]], {w, -Infinity, Infinity}]
Plot[fau[τ], {τ, 0, 5}]
fau[τ_] := NIntegrate[Re[int[3, 3, 4, τ]], {w, -Infinity, Infinity}]
Plot[fau[τ], {τ, 0, 5}]
However the obtained results are quite different, so my main question is is it possible that numerical algorithms suffer with these kind of integrals making them divergent when they're not?
NIntegrate
has troubles with it. $\endgroup$