# $\int_{0}^{\pi\over 2}\cos(x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}=\int_{0}^{\pi\over 2}\cos(3x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}=-\ln{2}?$

$$I=\int_{0}^{\pi\over 2}\cos(x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}$$

$$J=\int_{0}^{\pi\over 2}\cos(3x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}$$

How to show that $I=J=-\ln{2}?$

For Integral $I$

${\cos{x}\over 1+\tan{x}}={1-\sin^2{x}\over \sin{x}+\cos{x}}$

$$I=\int_{0}^{\pi\over 2}{\ln{\tan{x}}}{\mathrm dx\over \sin{x}+\cos{x}}-\int_{0}^{\pi\over 2}{\sin^2{x}}\ln(\tan{x}){\mathrm dx\over \sin{x}+\cos{x}}=I_1-I_2$$ 

$u=\tan{x}$ then $\mathrm dx=\cos^2{x}\mathrm du$

$$I_1=\int_{0}^{\infty}{\ln{u}}{\mathrm du\over (1+u)\sqrt{1+u^2}}$$

$$I_2=\int_{0}^{\infty}{u^2\ln{u}}{\mathrm du\over (1+u)(1+u^2)\sqrt{1+u^2}}$$

• Do the surnames Euler and Feynman ring a bell? :D – Jack D'Aurizio Nov 3 '17 at 22:40

As an alternative to the solution provided by Jack D'Aurizio, I will find a value to the integral $I$ by picking up where you left off.

For the first of your integrals $I_1$, if we write $$I_1 = \int^1_0 \frac{\ln x}{(1 + x) \sqrt{1 + x^2}} \, dx + \int^\infty_1 \frac{\ln x}{(1 + x) \sqrt{1 + x^2}} \, dx,$$ letting $x \mapsto 1/x$ in the second of these integrals we see that $$\int^\infty_1 \frac{\ln x}{(1 + x) \sqrt{1 + x^2}} \, dx = -\int^1_0 \frac{\ln x}{(1 + x) \sqrt{1 + x^2}} \, dx.$$ Thus $I_1 = 0$.

For the second of your integrals, we begin again by writing $$I_2 = \int^1_0 \frac{x^2 \ln x}{(1 + x)(1 + x^2) \sqrt{1 + x^2}} \, dx + \int^\infty_1 \frac{x^2 \ln x}{(1 + x)(1 + x^2) \sqrt{1 + x^2}} \, dx.$$ In the second of these integrals if we again let $x \mapsto 1/x$, then \begin{align*} I_2 &= \int^1_0 \frac{x^2 \ln x}{(1 + x)(1 + x^2) \sqrt{1 + x^2}} \, dx - \int^1_0 \frac{\ln x}{(1 + x)(1 + x^2) \sqrt{1 + x^2}} \, dx\\ &= \int^1_0 \frac{(x^2 - 1) \ln x}{(1 + x)(1 + x^2) \sqrt{1 + x^2}} \, dx = \int^1_0 \frac{(x - 1) \ln x}{(1 + x^2)^{3/2}} \, dx. \end{align*} Surprisingly (perhaps to some), this last integral can be found in elementary terms. To find it we write $$\int \frac{(x - 1) \ln x}{(1 + x^2) \sqrt{1 + x^2}} = \int \frac{x \ln x}{(1 + x^2)^{3/2}} \, dx - \int \frac{\ln x}{(1 + x^2)^{3/2}} \, dx = I_\alpha - I_\beta.$$

For the first integral $I_\alpha$, integrating by parts we have \begin{align*} I_\alpha &= \int \frac{x}{(1 + x^2)^{3/2}} \cdot \ln x \, dx\\ &= -\frac{\ln x}{\sqrt{1 + x^2}} + \int \frac{dx}{x \sqrt{1 + x^2}} \, dx\\&= -\frac{\ln x}{\sqrt{1 + x^2}} - \ln (\sqrt{1 + x^2} + 1) + \ln x + C_\alpha. \end{align*} (The integral that results after applying integration by parts can be found by applying a substitution of $x = \tan \theta$, for example)

For the second integral $I_\beta$, integrating by parts again gives \begin{align*} I_\beta &= \int \frac{1}{(1 + x^2)^{3/2}} \cdot \ln x \, dx\\ &= \frac{x \ln x}{\sqrt{1 + x^2}} - \int \frac{dx}{\sqrt{1 + x^2}}\\ &= \frac{x \ln x}{\sqrt{1 + x^2}} - \sinh^{-1} x + C_\beta. \end{align*} So $$\int \frac{(x - 1) \ln x}{(1 + x^2) \sqrt{1 + x^2}} \, dx = -\frac{(x + 1)\ln x}{\sqrt{1 + x^2}} - \ln (\sqrt{1 + x^2} + 1) + \ln x + \sinh^{-1} x + C.$$ Now, on applying the limits of integration we have \begin{align*} I_2 &= \int^1_0 \frac{(x - 1) \ln x}{(1 + x^2) \sqrt{1 + x^2}} \, dx = -\ln (1 + \sqrt{2}) + \ln 2 + \sinh^{-1} (1)\\ &= \ln \left (\frac{2}{1 + \sqrt{2}} \right ) + \ln (1 + \sqrt{2}) = \ln 2, \end{align*} giving $$I = I_1 - I_2 = 0 - \ln 2 = -\ln 2,$$ as expected.

$$I = \int_{0}^{\pi/2}\log\left(\frac{\sin x}{\cos x}\right)\frac{\cos(x)^2}{\sin(x)+\cos(x)}\,dx\stackrel{x\mapsto\frac{\pi}{2}-x}{=}\int_{0}^{\pi/2}-\log\left(\frac{\sin x}{\cos x}\right)\frac{\sin(x)^2}{\sin(x)+\cos(x)}\,dx$$ hence $$2I = \int_{0}^{\pi/2}\frac{\log(\tan x)\cos(2x)\,dx}{\sin(x)+\cos(x)}=\int_{0}^{+\infty}\frac{\log(t)\frac{(1-t^2)}{(1+t^2)}}{\frac{1+t}{\sqrt{1+t^2}}(1+t^2)}\,dt=\int_{0}^{+\infty}\frac{\log(t)(1-t)}{(1+t^2)^{3/2}}\,dt$$ and the explicit computation of $I$ is made simple by the following Lemma $$\forall \alpha\in(-1,2),\qquad \int_{0}^{+\infty}\frac{t^\alpha}{(1+t^2)^{3/2}}\,dt = \tfrac{1}{\sqrt{\pi}}\,\Gamma\left(1-\tfrac{\alpha}{2}\right)\,\Gamma\left(\tfrac{1+\alpha}{2}\right)$$ (which follows from the properties of Euler's Beta function) and differentiation (with respect to $\alpha$, of course) under the integral sign. $J$ can be dealt in a similar way and $I=J=-\log 2$ turns out to be a consequence of $$\gamma+\psi\left(\tfrac{1}{2}\right) = -2\log 2.$$

I have a simple solution without using special functions. Note \begin{eqnarray} I-J&=&\int_{0}^{\pi\over 2}[\cos(x)-\cos(3x)]\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}\\ &=&-2\int_{0}^{\pi\over 2}\sin(2x)\sin(x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}\\ &=&-2\int_{0}^{\pi\over 2}\frac{\sin(2x)\sin(x)\cos(x)}{\cos(x)+\sin(x)}\ln(\tan{x}){\mathrm dx}\\ &=&-\int_{0}^{\pi\over 2}\frac{\sin^2(2x)}{\cos(x)+\sin(x)}\ln(\tan{x}){\mathrm dx}. \tag{1} \end{eqnarray} Under $x\to\frac{\pi}{2}-x$, (1) becomes \begin{eqnarray} I-J&=&\int^{0}_{\pi\over 2}\frac{\sin^2(2x)}{\cos(x)+\sin(x)}\ln(\cot{x}){\mathrm dx}\\ &=&\int_{0}^{\pi\over 2}\frac{\sin^2(2x)}{\cos(x)+\sin(x)}\ln(\tan{x}){\mathrm dx}.\tag{2} \end{eqnarray} Adding (1) and (2), one has $2(I-J)=0$ or $I=J$. Note \begin{eqnarray} I+J&=&\int_{0}^{\pi\over 2}[\cos(x)+\cos(3x)]\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}\\ &=&2\int_{0}^{\pi\over 2}\cos(2x)\cos(x)\ln(\tan{x}){\mathrm dx\over 1+\tan(x)}\\ &=&2\int_{0}^{\pi\over 2}\frac{\cos(2x)\cos^2(x)}{\cos(x)+\sin(x)}\ln(\tan{x}){\mathrm dx}\\ &=&2\int_{0}^{\pi\over 2}[\cos(x)-\sin(x)]\cos^2(x)\ln(\tan{x}){\mathrm dx}. \tag{3} \end{eqnarray} Under $x\to\frac{\pi}{2}-x$, (3) becomes \begin{eqnarray} I+J&=&-2\int^{0}_{\pi\over 2}[\sin(x)-\cos(x)]\sin^2(x)\ln(\cot{x}){\mathrm dx}\\ &=&2\int_{0}^{\pi\over 2}[\cos(x)-\sin(x)]\sin^2(x)\ln(\tan{x}){\mathrm dx}.\tag{4} \end{eqnarray} Add (3) and (4), one has \begin{eqnarray} I+J&=&\int_{0}^{\pi\over 2}[\cos(x)-\sin(x)]\ln(\tan{x}){\mathrm dx}\\ &=&-2\ln2 \end{eqnarray} and hence $I=J=-\ln2$.

• After adding (3) to (4) a factor of two has not been cancelled. The final result should be $I = J = -\ln 2$. – omegadot Nov 4 '17 at 4:47
• @omegadot, you are right. – xpaul Nov 4 '17 at 15:49