# How to evaluate this integral $\int_0^{\frac{\pi}{2}}(\ln(\tan x))^2dx$?

How to evaluate this integral ? $$\int_0^{\frac{\pi}{2}}(\ln(\tan x))^2dx$$ I changed it to $$\int_{-\infty}^{\infty}\frac{x^2e^x}{e^{2x}+1}dx$$ Thanks in advance.

-

## 1 Answer

The integral is $$I=\int_{-\infty}^\infty\frac{x^2e^x}{e^{2x}+1}=2J$$Where, $$J=\int_{0}^\infty\frac{x^2e^x}{e^{2x}+1}dx=\int_{0}^{\infty}\frac{x^2e^{-x}}{e^{-2x}+1}dx=\int_{0}^{\infty}x^2e^{-x}\sum_{k=0}^{\infty}(-1)^k e^{-2kx}dx\\=\sum_{k=0}^{\infty}(-1)^k\int_{0}^{\infty}x^2e^{-(2k+1)x}dx\quad(\mbox{Can be justified by Fubini's theorem})\\ =\sum_{k=0}^{\infty}\frac{(-1)^k}{(2k+1)^3}\Gamma(3)$$ The answer provided by RonGordon to this series can be found in the link provided by him. This shows that the integral evaluates to $\frac{\pi^3}{8}$.

-
WolframAlpha spat out an answer of $\frac{\pi^3}{8}$. It would be nice if we could equate your series to that value. My gut tells it's already been demonstrated somewhere on this site. –  David H Feb 20 at 15:13
I'm trying to find its value. –  Samrat Mukhopadhyay Feb 20 at 15:41
Thanks @RonGordon for the link to the series. –  Samrat Mukhopadhyay Feb 20 at 16:53
Thank you very much –  kong Feb 20 at 17:58