Calculate the value of $\int_0^\infty \frac{\sqrt{x}\cos(\ln(x))}{x^2+1}\,dx$

complex-analysiscontour-integrationresidue-calculus

I'm asked to evaluate the integral $\displaystyle\int_0^\infty \frac{\sqrt{x}\cos(\ln(x))}{x^2+1}\,dx$.

I tried defining a funcion $f(z)=\frac{e^{(1/2+i)\operatorname{Log}(z)}}{z^2+1}$, taking $\operatorname{Log}$ with a branch cut along the positive real axis: ($\operatorname{Log}(z)=\ln(|z|)+i\arg(z))$.

Using residue theorem with the "pacman" contour.

However when trying to bound the integral around a small circle around $0$, I cannot conclude it converges to $0$.

My attempt was $|\int_{\gamma_\epsilon}f|\leq 2\pi\epsilon|e^{(0.5+i)(\ln|\epsilon|+i\theta))}|\frac{1}{\epsilon^2-1}\leq C\epsilon^{-0.5}.$

I'd love it if someone could either suggest a different way to bound the integral around $0$ of this function, or maybe suggest an easier complex function to work
with.

Edit:

The wonderful "Related" algorithm of this site managed to link me to this answer
Looking at it , a more general statement is proved, but the proof fails when we have $\alpha=0.5+i$ (The circle around $0$ doesn`t converge to $0$ by the proof given there, as a matter of fact any $\alpha$ with $Re(\alpha)>0$ would fail.)

Best Answer

As @Adrian suggested, define $\log z =\log |z|+i\arg(z)$ where $\arg(z)\in (0,2\pi)$ and let the contour be a keyhole contour.
enter image description here

Then $$ \left|\int_{\gamma_R}\frac{e^{(1/2+i)\log z}}{z^2+1}\,dz\right|\le \int_{\gamma_R}\frac{e^{1/2 \log|z|-\arg(z)}}{R^2-1}\,|dz|\le C\frac{R^{3/2}}{R^2-1}\stackrel{R\to\infty}\longrightarrow 0, $$ $$ \left|\int_{\gamma_r}\frac{e^{(1/2+i)\log z}}{z^2+1}\,dz\right|\le \int_{\gamma_r}\frac{e^{1/2 \log|z|-\arg(z)}}{1-r^2}\,|dz|\le Cr^{3/2}\stackrel{r\to 0}\longrightarrow 0. $$ Thus it follows by residue theorem $$ \lim_{\epsilon\to 0}\left(\int_{\gamma_\epsilon} f(z)dz +\int_{\gamma_{-\epsilon}} f(z)dz\right) =2\pi i\left(\text{res}_{z=i}f(z)+\text{res}_{z=-i}f(z)\right). $$ We find$$ \lim_{\epsilon\to 0}\int_{\gamma_\epsilon} f(z)dz=\int_0^\infty \frac{\sqrt{x}e^{i\ln x}}{x^2+1}\,dx, $$ $$ \lim_{\epsilon\to 0}\int_{\gamma_{-\epsilon}} f(z)dz=-\int_0^\infty \frac{e^{(1/2+i)(\ln x+2\pi i)}}{x^2+1}\,dx=+e^{-2\pi}\int_0^\infty \frac{\sqrt{x}e^{i\ln x}}{x^2+1}\,dx. $$ And also $$ \text{res}_{z=i}f(z)=\frac{e^{(1/2+i)\frac{\pi i}{2}}}{2i}=\frac{e^{-\pi/2+\pi i/4}}{2i}, $$ $$ \text{res}_{z=-i}f(z)=-\frac{e^{(1/2+i)\frac{3\pi i}{2}}}{2i}=-\frac{e^{-3\pi/2+3\pi i/4}}{2i}. $$ Thus the given integral is $$ \frac{\pi}{1+e^{-2\pi}}\Re\left(e^{-\pi/2+\pi i/4}-e^{-3\pi/2+3\pi i/4}\right)=\frac{\pi\cosh(\frac{\pi}{2})}{\sqrt{2}\cosh(\pi)}\sim 0.4805. $$ (I found that this value coincides with the integral numerically by wolframalpha.)