# Integral$\int_0^{\pi/4} \log \tan \left(\frac{\pi}{4}\pm x\right)\frac{dx}{\tan 2x}=\pm\frac{\pi^2}{16}$

Hi I am trying to prove $$\int_0^{\pi/4} \log \tan \left(\frac{\pi}{4}\pm x\right)\frac{dx}{\tan 2x}=\pm\frac{\pi^2}{16}.$$ What an amazing result and a clever one this is. I tried writing $$\int_0^{\pi/4} \log \sin \left(\frac{\pi}{4}\pm x\right)\frac{dx}{\tan 2x}-\int_0^{\pi/4} \log \cos \left(\frac{\pi}{4}\pm x\right)\frac{dx}{\tan 2x}.$$ Changing variables $y=2x$ I obtained $$\frac{1}{2}\int_0^{\pi/2} \log \sin \left(\frac{\pi}{4}\pm \frac{y}{2}\right)\frac{dy}{\tan y}-\frac{1}{2}\int_0^{\pi/2} \log \cos \left(\frac{\pi}{4}\pm \frac{y}{2}\right)\frac{dy}{\tan y}.$$ I would rather work with the log sine/cosines for $y\in [0,\pi/2]$ since we can use $\int_0^{\pi/2} \log \sin x dx=-\frac{\pi}{2} \ln 2.$ But I am stuck here. Thanks

• Be careful $\sin(-\pi/4)$ is negative. As is $\cos(3\pi/4)$ Commented May 3, 2014 at 6:39
• Fee-fi-fo-fum, I smell a Weierstraß substitution... Commented May 3, 2014 at 6:56
• @DavidH, we've been getting a lot of these lately haven't we? Commented May 3, 2014 at 7:20
• @Nameless Or maybe there have always been lots of 'em, and they were just too darn sneaky! Commented May 3, 2014 at 7:35

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{\pi/4}\ln\pars{\tan\pars{{\pi \over 4} \pm x}}\, {\dd x \over \tan\pars{2x}} = \pm\,{\pi^{2} \over 16}:\ {\large ?}}$

We'll performed both calculations simultaneously.

Set $\quad\ds{t \equiv {\pi \over 4} \pm x\quad\imp\quad x = \pm\pars{t - {\pi \over 4}}}$:

\begin{align}&\color{#66f}{\large\int_{0}^{\pi/4} \ln\pars{\tan\pars{{\pi \over 4} \pm x}}\,{\dd x \over \tan\pars{2x}}} \\[3mm]&=\int_{\pi/4}^{\braces{\pi/2 \atop {\vphantom{\Huge A}0}}} \ln\pars{\tan\pars{t}}\,{\pm\,\dd t \over \tan\pars{\pm\bracks{2t - \pi/2}}} \\[3mm]&=-\int_{\pi/4}^{\braces{\pi/2 \atop {\vphantom{\Huge A}0}}} \ln\pars{\tan\pars{t}}\tan\pars{2t}\,\dd t =-\,\half\int_{\pi/2}^{\braces{\pi \atop {\vphantom{\Huge A}0}}} \ln\pars{\tan\pars{t \over 2}}\tan\pars{t}\,\dd t \\[3mm]&=-\,\half\int_{1}^{\braces{\infty \atop {\vphantom{\Huge A}0}}} \ln\pars{t}{2t \over 1 - t^{2}}\,{2\,\dd t \over 1 + t^{2}} =-2\int_{1}^{\braces{\infty \atop {\vphantom{\Huge A}0}}} {t\ln\pars{t} \over 1 - t^{4}}\,\dd t \\[3mm]&=\mp\, 2\int_{0}^{1}{t^{1/4}\ln\pars{t^{1/4}} \over 1 - t}\,{1 \over 4} \,t^{-3/4}\,\dd t =\mp\,{1 \over 8}\ \underbrace{% \int_{0}^{1}{t^{-1/2}\ln\pars{t} \over 1 - t}\,\dd t} _{\ds{=\ -\,{\pi^{2} \over 2}}} =\color{#66f}{\Large\pm\,{\pi^{2} \over 16}} \end{align}

We can write the integral as: \begin{align*} \int_0^{\pi/4} \frac{\log{\tan{(\frac{\pi}{4}-x)}}}{\tan{(2x)}}\, dx &= \int_0^{\pi/4} \log{\tan{(x)}}\tan{(2x)} \, dx \\ \end{align*}

Let \begin{align*} I(a) &= \int_0^{\pi/4} \tan{(x)}^a\, \tan{(2x)} dx \\ &= \int_0^{\pi/4} \frac{2\, \tan{(x)}^{a+1}}{1-\tan{(x)}^2} dx\\ &=\int_0^1 \frac{2\, t^{a+1}}{1-t^4}\, dt\\ &=\int_0^1 2\, t^{a+1}\, \sum_{n\ge 0} t^{4n}\, dt\\ &=\sum_{n\ge 0} \int_0^1 2\, t^{a+1+4n}\, dt\\ &=\sum_{n\ge 0} \frac{2}{a+2+4n} \end{align*}

and the required integral is:

\begin{align*} I'(0) &= \sum_{n\ge 0} -\frac{2}{(4n+2)^2}\\ &= -\frac{2}{4}\cdot \frac{3}{4} \zeta{(2)} = -\frac{\pi^2}{16} \end{align*}

and in general,

\begin{align*} I^{(n)}(0) = \boxed{\displaystyle \int_0^{\pi/4} \frac{\left(\log{\tan{\left(\frac{\pi}{4}- x\right)}}\right)^n}{\tan{(2x)}}\, dx = \frac{\left(-1\right)^{n} n!}{2^n} \left(1-\frac{1}{2^{n + 1}}\right) \zeta(n + 1)} \end{align*}

and proceeding similarly for the other case:

\begin{align*} \boxed{\displaystyle \int_0^{\pi/4} \frac{\left(\log{\tan{\left(\frac{\pi}{4}+ x\right)}}\right)^n}{\tan{(2x)}}\, dx = \frac{n!}{2^n} \left(1-\frac{1}{2^{n + 1}}\right) \zeta(n + 1)} \end{align*}

• You're welcome!
– gar
Commented May 9, 2014 at 2:54

Writing $$\log \tan \left(\frac{\pi}{4}+ x\right)\frac{1}{\tan 2x}=\frac{1}{2} \left(1-\tan ^2(x)\right) \cot (x) \log \left(\frac{1+\tan (x)}{1-\tan (x)}\right)$$ and using a CAS, the antiderivative can be found (its expression is really long and I shall not reproduce it here). Using the integration bounds, the result is found.

By letting $t=\dfrac\pi4\pm x$, and using the fact that $\tan\Big(a\pm\frac\pi2\Big)=-\cot a$, and $\tan2t=\dfrac{2\tan t}{1-\tan^2t}$ ,

then further substituting $u=\tan t$, and $v=u^2$, this then becomes equivalent to proving that

$\displaystyle\int_0^1\frac{\ln v}{1-v^2}dv=-\frac{\pi^2}8$ . This is done by expanding the denominator into its binomial series, then

switching the order of summation and integration, and recognizing the expression of the Riemann $\zeta$ function in the ensuing series.