It is easy to compute by hand the following integral.
$$ Q(k) = \lim \limits_{\varepsilon \to 0} \int_2^{\infty} \frac{e^{-\varepsilon r}}{k}\sin(kr) \mathrm{d}r = \frac{\cos(2k)}{k^2}$$
I wanted to use smoothened version of step function to compute this integral using Mathematica. My idea was to rewrite this integral in the following way.
$$ Q(k) = \lim \limits_{\varepsilon \to 0} \int_0^{\infty} \Theta(r-2) \frac{e^{-\varepsilon r}}{k}\sin(kr) \mathrm{d}r$$
Here, I use step function $\Theta(r-2)$ in the following smooth form.
$$ \Theta(r-2) = \frac{1}{2} + \frac{1}{2} \tanh(1000(r-2)) $$
I would like to compute this integral in this way and then compare it to the result $\cos(2k)/k^2$. To do the computations, I use the following code.
Regularized[k_, epsilon_] := Assuming[epsilon >= 0 && k >= 0, Integrate[Sin[x*k]/k*Exp[-epsilon*x]*(0.5 + 0.5*Tanh[1000*(x - 2)]), {x, 0, Infinity}]];
ft[k_] := Limit[Regularized[k, P], P -> 0, Direction -> "FromAbove"];
To compare, I now do two plots using the following commands.
Plot[ft[k], {k, 0, 10}]
Plot[Cos[2 k]/(k*k), {k, 0, 10}]
My problem is that this computation takes more than 2 hours on my PC (which is not that old), and I have not yet seen the final result, so I wonder if I do something wrong. Maybe this approximation for step function is bad and instead of $\tanh$ I should use something else? Or is there a problem with my Mathematica code? Any help is very much appreaciated