# Evaluate $\int_0^\infty \frac{\sqrt{x}}{x^2+1}\log\left(\frac{x+1}{2\sqrt{x}}\right)\;dx$

Prove that $$\int_0^\infty \frac{\sqrt{x}}{x^2+1}\log\left(\frac{x+1}{2\sqrt{x}}\right)\;dx=\frac{\pi\sqrt{2}}{2}\log\left(1+\frac{\sqrt{2}}{2}\right).$$ I managed to prove this result with some rather roundabout complex analysis (writing the log term as an infinite sum involving nested logs), but I am hoping for a more direct solution via complex or real methods. The log term seems to require a rather complicated branch cut, so I am unsure as to how to solve the problem with a different technique.

We can transform the integral into a form that has only one simple branch point that needs to be considered. First, let $x=u^2$, and the integral is

$$\int_0^\infty dx \frac{\sqrt{x}}{x^2+1}\log\left(\frac{x+1}{2\sqrt{x}}\right) = 2 \int_0^{\infty} du \frac{u^2}{1+u^4} \log{\left ( \frac{1+u^2}{2 u} \right )}$$

which may be rewritten as

$$-2 \log{2} \int_0^{\infty} du \frac{u^2}{1+u^4} + 2 \int_0^{\infty} \frac{du}{u^2+\frac1{u^2}} \log{\left ( u+\frac1{u} \right )} \qquad (*)$$

Let's worry about the latter integral. By subbing $v=u+1/u$, we get (exercise for the reader):

$$2 \int_0^{\infty} \frac{du}{u^2+\frac1{u^2}} \log{\left ( u+\frac1{u} \right )} = 2 \int_2^{\infty} dv \frac{v}{\sqrt{v^2-4}} \frac{\log{v}}{v^2-2}$$

Finally, sub $v^2=y^2+4$, so we get

$$2 \int_0^{\infty} \frac{du}{u^2+\frac1{u^2}} \log{\left ( u+\frac1{u} \right )}= \frac12 \int_{-\infty}^{\infty} dy \frac{\log{(y^2+4)}}{y^2+2}$$

Now we have an integral ripe for the residue theorem. Consider

$$\oint_C dz \frac{\log{(z^2+4)}}{z^2+2}$$

where $C$ is a semicircle of radius $R$ in the upper half plane, with a detour about the branch point at $z=i 2$ and up and down the imaginary axis. (For a picture, see this.) By the residue theorem, the contour integral is equal to

$$\underbrace{\int_{-\infty}^{\infty} dx \frac{\log{(x^2+4)}}{x^2+2}}_{\text{Integral over the real axis}} \underbrace{-i 2 \pi (i) \int_2^{\infty} \frac{dy}{2-y^2}}_{\text{integral over imaginary axis about branch point } z=i 2} = i 2 \pi \underbrace{\frac{\log{2}}{i 2 \sqrt{2}}}_{\text{residue at pole }z=i \sqrt{2}}$$

Thus, the second integral in (*) is equal to

$$\pi \int_2^{\infty} \frac{dy}{y^2-2} + \frac{\pi}{2 \sqrt{2}} \log{2}$$

and

$$\int_2^{\infty} \frac{dy}{y^2-2} = \frac{1}{2 \sqrt{2}} \log{(3+2 \sqrt{2})}$$

For the first integral in (*), we may use the residue theorem again, this time over a simple quarter-circle $Q$ in the upper right half plane. Thus, the integral we seek is, by the residue theorem,

$$\oint_Q dz \frac{z^2}{1+z^4} = (1+i) \int_0^{\infty} du \frac{u^2}{1+u^4} = i 2 \pi \frac{e^{i 2 \pi/4}}{4 e^{i 3 \pi/4}}$$

Thus,

$$\int_0^{\infty} du \frac{u^2}{1+u^4} = \frac{\pi}{2 \sqrt{2}}$$

Putting this all together, we finally get that the original integral is equal to

$$\int_0^\infty dx \frac{\sqrt{x}}{x^2+1}\log\left(\frac{x+1}{2\sqrt{x}}\right) =-\frac{\pi}{\sqrt{2}} \log{2} + \frac{\pi}{2 \sqrt{2}} \log{(3+2 \sqrt{2})} + \frac{\pi}{2 \sqrt{2}} \log{2}$$

or

$$\int_0^\infty dx \frac{\sqrt{x}}{x^2+1}\log\left(\frac{x+1}{2\sqrt{x}}\right) = \frac{\pi}{\sqrt{2}} \log{\left ( 1+\frac1{\sqrt{2}} \right )}$$

as was to be shown.

• Excellent solution - thank you for the detailed explanation! – Showhat Aug 20 '15 at 18:52
• @RonGordon Well done. I proceeded a bit differently ... but recovered the same result. – Mark Viola Aug 20 '15 at 21:48

We begin by writing the integral of interest $I$ as

\begin{align} I&=\int_0^{\infty} \frac{x^{1/2}}{x^2+1}\log\left(\frac{x+1}{2x^{1/2}}\right)\,dx\\\\ &=I_1+I_2+I_3 \end{align}

where

\begin{align} I_1&=-\log (2)\,\int_0^{\infty} \frac{x^{1/2}}{x^2+1}\,dx\\\\ I_2&=-\frac12\,\int_0^{\infty} \frac{x^{1/2}\log x}{x^2+1}\,dx\\\\ I_3&=\int_0^{\infty} \frac{x^{1/2}\log (x+1)}{x^2+1}\,dx \end{align}

Evaluating $I_1$ and $I_2$ are rather straightforward, so we defer evaluating until later in the development. For $I_3$ we use the method of Integrating Under The Integral Sign. To that end, let $F(a)$ be given by

$$F(a)=\int_0^{\infty}\frac{x^{1/2}\log (x+a)}{x^2+1}\,dx$$

Note that $I_3=F(1)$ and $-2I_2=F(0)$. Now, differentiating reveals

$$F'(a)=\int_0^{\infty}\frac{x^{1/2}}{(x^2+1)(x+a)}\,dx$$

The indefinite integral $\int\frac{x^{1/2}}{(x^2+1)(x+a)}\,dx$ can be found in terms of elementary functions and we leave that as an exercise for the reader. Alternatively, we can evaluate $F'(a)$ through analysis in the complex plane and integrating over the classic keyhole contour. Using the latter approach we have

\begin{align} \oint_C \frac{z^{1/2}}{(z^2+1)(z+a)}\,dx&=\int_0^\infty\frac{x^{1/2}}{(x^2+1)(x+a)}\,dx-\int_\infty^0 \frac{x^{1/2}}{(x^2+1)(x+a)}\,dx\\\\ &=2\pi i \left(\frac{e^{i\pi/4}}{2i(a+i)}+\frac{e^{i3\pi/4}}{-2i(a-i)}+\frac{ia^{1/2}}{-(i+a)(i-a)}\right)\\\\ &=2\pi\left(\frac{\sqrt{2}}{2}\frac{a+1}{a^2+1}-\frac{\sqrt{a}}{a^2+1}\right) \end{align}

Therefore, $F'(a)$ is given by

$$F'(a)=\pi\left(\frac{\sqrt{2}}{2}\frac{a+1}{a^2+1}-\frac{\sqrt{a}}{a^2+1}\right)$$

Integrating $F'(a)$ between $a=0$ and $a=1$, we obtain

\begin{align} I_3&=-2I_2+\int_0^1 \pi\left(\frac{\sqrt{2}}{2}\frac{x+1}{x^2+1}-\frac{\sqrt{x}}{x^2+1}\right)\,dx\\\\ &=\bbox[5px,border:2px solid #C0A000]{-2I_2+\pi\frac{\sqrt{2}}{2}\left(\frac12\log(2)+\frac{\pi}{4}\right)-\pi\frac{\sqrt{2}}{4}\left(\pi-\log(2) -2\log\left(1+\frac{\sqrt{2}}{2}\right)\right)} \tag 1 \end{align}

We now evaluate $I_1$ and $I_2$ in a uniform manner. To do this, let $G(a)$ be the integral

$$G(a)=\int_0^{\infty}\frac{x^{a}}{x^2+1}\,dx$$

Note that $I_1=-\log(2)G(1/2)$ and $I_2=-\frac12 G'(1/2)$. We evaluate $G(a)$ by again moving to the complex plane and analyzing the closed-contour integral of $\frac{z^{a}}{z^2+1}$ around the keyhole contour. We obtain

\begin{align} \oint_C \frac{z^{a}}{z^2+1}\,dz&=(1-e^{i2\pi a})\int_0^{\infty}\frac{x^a}{x^2+1}\,dx\\\\ &=(1-e^{i2\pi a})G(a)\\\\ &=2\pi i\left(\frac{e^{i\pi a/2}}{2i}+\frac{e^{i3\pi a/2}}{-2i}\right)\\\\ G(a)&=\frac{\pi}{2\cos(\pi a/2)} \end{align}

Thus,

$$\bbox[5px,border:2px solid #C0A000]{I_1=-\log (2) \frac{\pi}{\sqrt{2}}} \tag 2$$

and

$$\bbox[5px,border:2px solid #C0A000]{I_2=-\frac12 \frac{\pi^2\sqrt{2}}{4}} \tag 3$$

Putting it all together, we have

$$\bbox[5px,border:2px solid #C0A000]{I=I_1+I_2+I_3=\frac{\pi}{\sqrt{2}}\log\left(1+\frac{\sqrt{2}}{2}\right)}$$

as expected!!

• As a wise young man once said, there's more than one way to skin an integral. – Ron Gordon Aug 20 '15 at 21:51
• @rongordon Who was that wise young man? I was going to say the same thing, but am not all that wise or young. Kidding aside, I liked your approach for its bundling everything together. And I like this approach because I got to use both differentiating under the integral sign AND integrating under the integral sign. How often does that occur. – Mark Viola Aug 20 '15 at 22:06
• @cody was that wise young man. – Ron Gordon Aug 20 '15 at 22:06
• @rongordon Well, I was giving your work credit more than dismissing mine as somehow less valid. – Mark Viola Aug 21 '15 at 16:00
• And it is appreciated. I just wanted to point that out. No reflection on your good work. – Ron Gordon Aug 21 '15 at 17:13