# Is there a simpler method to compute $\int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{2n } x\right)} d x$

When I encountered the integral $$\int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{2 } x\right)} d x$$, I tried the substitution $$x\mapsto \frac{1}{x}$$ and found a wonderful result. $$I=\int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{2 } x\right)} d x \stackrel{x\mapsto\frac{1}{x}}{=} \int_0^{\infty} \frac{1}{x(1+x)\left(\pi+\ln ^{2 } x\right)} d x$$ Averaging them yields

\begin{aligned} I & =\frac{1}{2} \int_0^{\infty}\left[\frac{1}{(1+x)\left(\pi+\ln ^2 x\right)}+\frac{1}{x(1+x)\left(\pi+\ln ^2 x\right)}\right]dx\\ & =\frac{1}{2} \int_0^{\infty} \frac{1}{x\left(\pi+\ln ^2 x\right)} d x \\ & =\frac{1}{2} \int_0^{\infty} \frac{1}{\pi+\ln ^2 x} d(\ln x) \\ & =\frac{1}{2 \sqrt{\pi}}\left[\tan ^{-1}\left(\frac{\ln x}{\sqrt{\pi}}\right)\right]_0^{\infty}\\ & =\frac{\sqrt{\pi}}{2} \end{aligned}

Then I want to generalize the result to the integral

$$I_n=\int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{2n } x\right)} d x$$ By replacing the power $$2$$ by $$2n$$, we have \begin{aligned} I_n & =\frac{1}{2} \int_0^{\infty} \frac{1}{x\left(\pi+\ln ^{2 n} x\right)} d x\\ &= \frac{\sqrt[2 n]{\pi}}{2\pi} \int_{-\infty}^{\infty} \frac{1}{1+x^{2 n}} d x \quad (\textrm{ via } \ln x \mapsto \sqrt[2 n]{\pi} x) \end{aligned} Using the well-known result $$\int_0^{\infty} \frac{d x}{1+x^n}=\frac{\pi}{n} \csc \left(\frac{\pi}{n}\right)$$, we have $$I_n=\frac{\sqrt[2 n]{\pi}}{2 n} \csc \left(\frac{\pi}{2 n}\right)$$ For simplicity, given any even integer $$m$$, we have $$\boxed{\int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{m } x\right)} d x =\frac{\sqrt[m]{\pi}}{m} \csc \left(\frac{\pi}{m}\right)}$$

For examples, \begin{aligned} & \int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{2 } x\right)} d x =\frac{\sqrt{\pi}}{2} \\ & \int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{4 } x\right)} d x =\frac{\sqrt[4]{\pi}}{2 \sqrt{2}} \\ & \int_0^{\infty} \frac{1}{(1+x)\left(\pi+\ln ^{6 } x\right)} d x =\frac{\sqrt[6]{\pi}}{3} \end{aligned}

Are there any other methods? Comments and alternative methods are highly appreciated.

• This is a very elegant solution. (+1) Commented Mar 31, 2023 at 11:54
• Your appreciation supports me to do more investigations in future. Thank you very much!
– Lai
Commented Mar 31, 2023 at 12:37
• I am not the type to give compliments for nothing. During the last three years, I followed your questions and answers. You have a real talent. Cheers :-) Commented Mar 31, 2023 at 12:43
• Hi Lai, could you tell me what you meant by averaging I and what is the motivation behind that. Great solution by the way... Commented Mar 31, 2023 at 12:44
• It means to take the average of the two versions of the integral so as to cancel and hence get rid of the term (1+x) in the denominator. Wish you understand!
– Lai
Commented Mar 31, 2023 at 13:33

$$I_n=\int_0^{\infty} \frac{1}{x(1+x^a)\left(\pi+\ln ^{2n } x\right)}\ dx =\frac{\pi^{\frac1{2n}}}{2n\sin\frac\pi{2n}}$$
• $I=\frac{1}{2} \int_0^{\infty} \frac{d x}{x^{2-a}\left(\pi+\ln ^{2n }x\right)}$ can’t be continued. Am I right?
• @Lai - You would have $\int_0^{\infty} \frac{dx}{x(1+x^a)\left(\pi+\ln ^{2n } x\right)} \overset{x\to \frac1x}= \int_0^{\infty} \frac{dx}{x(1+x^{-a})\left(\pi+\ln ^{2n } x\right)}$ Commented Apr 27, 2023 at 0:01
• Yes, you are right! I forgot that you added $x$ in the denominator in addition to $x^a$. Thank you very much for your extension,