Let $\kappa>0$ be given. What is the function $f:\mathbb{R}\to [0,\infty)$ with $\int_\mathbb{R} f(x) dx = 1$ such that $$\int_\mathbb{R} |x| f(x) dx + \kappa \int_{|t|\geq T}\left| \frac{\widehat{f}(t)}{t} \right| dt$$ is minimal?
Commentary. The motivation of this question resides in its applications to bounds in analytic number theory -- for example, explicit versions of the prime number theorem. The question is essentially equivalent to the one I have asked in Best smoothing for the Prime Number Theorem? and Optimizing a smoothing function with the Prime Number Theorem in mind . The main difference is that now I have a plausible candidate: we could work with $$f(x) = \frac{1/\sigma}{\sqrt{2 \pi}} e^{-\frac{1}{2} \left(\frac{x}{\sigma}\right)^2}.$$ Since then $$\int_{\mathbb{R}} |x| f(x) dx = 2 \int_0^\infty \frac{x/\sigma}{\sqrt{2\pi}} e^{-\frac{1}{2} \left(\frac{x}{\sigma}\right)^2} dx = - \frac{2\sigma}{\sqrt{2\pi}} \int_0^\infty \left(e^{-\frac{1}{2} \left(\frac{x}{\sigma}\right)^2}\right)' dx = \sqrt{\frac{2}{\pi}} \cdot\sigma$$ and, by $\widehat{f}(t) = e^{-2 \pi^2 \sigma^2 t^2}$, $$\frac{\partial}{\partial \sigma}\int_{|t|\geq T} \left|\frac{\widehat{f}(t)}{t}\right| dt = 2\frac{\partial}{\partial \sigma} \int_{t\geq T} \frac{e^{-2\pi^2 \sigma^2 t^2}}{t} dt = - 2 \int_{t\geq T} 4 \pi^2 \sigma t e^{-2\pi^2\sigma^2 t^2} dt = - 2\frac{e^{-2\pi^2 \sigma^2 T^2}}{\sigma} ,$$ we see that the optimal value of $\sigma$ is the one for which $\sigma = \sqrt{2\pi} \kappa \cdot e^{-2 \pi^2 \sigma^2 T^2}$. We write $\sigma = \frac{\sqrt{2 \log T + \eta}}{2 \pi T}$, and see we must solve for $\frac{\sqrt{2 \log T + \eta}}{2\pi} = \sqrt{2\pi} \kappa e^{-\eta/2}$, so $\eta = -2 \log \frac{\sqrt{\log T}}{2\pi^{3/2}\kappa} + O\left(\frac{1}{\log T}\right) = - \log \log T + 2 \log(2 \pi^{3/2} \kappa) + O\left(\frac{1}{\log T}\right)$.
Then $$\begin{aligned}\int_\mathbb{R} |x| f(x) dx + \kappa \int_{|t|\geq T}\left| \frac{\widehat{f}(t)}{t} \right| dt &= \sqrt{\frac{2}{\pi}} \sigma + 2 \kappa \int_{t\geq T} \frac{e^{-2\pi^2 \sigma^2 t^2}}{t} dt\\ &= \sqrt{\frac{2}{\pi}} \sigma - \kappa \textrm{Ei}(-2\pi^2 \sigma^2 T^2) = \sqrt{\frac{2}{\pi}} \sigma- \kappa \textrm{Ei}(- \log T - \eta/2) \\ &\sim \frac{\sqrt{\log(2\pi^{3/2} \kappa T) - \frac{1}{2} \log \log T}}{\pi^2 T} + \kappa \sqrt{\frac{2}{\pi}} \frac{e^{-\eta/2}}{T (\log T + \frac{\eta}{2})}\\ &= \frac{1}{\pi^2 T} \left(\sqrt{\log(2\pi^{3/2} \kappa T)} - \frac{\log \log T}{4 \sqrt{\log 2\pi^{3/2} \kappa T}} + \frac{1}{\sqrt{2\log T}} + \dotsc\right). \end{aligned}$$ Can one do better?