# Evaluating $\int\limits_0^{\pi/4}\log(1+\tan x)\,\mathrm dx$

Can someone give me a hint on how to evaluate the closed form of the following integral? According to Wolfram Alpha, this evaluates to $\dfrac{\pi}8\log(2)$.

$$\int\limits_0^{\pi/4}\log(1+\tan x)\,\mathrm dx$$

Thanks.

p.s - Hints are preferred over complete solutions.

• Hint: write x=pi/4 -x....by using property – Sujan Dutta Aug 21 '16 at 16:37
• Then write 1=tan(pi/4).....then use formula of tan(a)+tan(b) – Sujan Dutta Aug 21 '16 at 16:39
• At last you will probably have to use properties of log. – Sujan Dutta Aug 21 '16 at 16:41
• – lab bhattacharjee Aug 21 '16 at 17:45

Hint. By the change of variable $$x=\frac{\pi}4-u, \qquad dx=-du, \qquad 1+ \tan x=? \qquad \log(1+ \tan x)=?$$

$$I=\int^{\frac{\pi }{4} }_{0}\ln\left( 1+\tan x \right)\ dx=\int ^{\frac{\pi }{4} }_{0}\ln\left( 1+\tan \left( \frac{\pi }{4} -x\right) \right)\ dx=\int^{\frac{\pi }{4} }_{0}\ln\left( 2\right)\ dx-I$$ So we have $$2I=\ln\left( 2\right) \int ^{\frac{\pi }{4} }_{0}\ dx=\ln\left( 2\right) \times \frac{\pi }{4}$$ Hence we get$$I= \boxed{\frac{\pi }{8} \ln\left( 2\right)}$$

• It is essentially the Oliver Oloa's answer. – Marco Cantarini Aug 21 '16 at 16:50
• @MarcoCantarini yes. But I think this would help those who can't complete the answer. – user354387 Aug 21 '16 at 17:21
• +1. It's always fine to show the answer at the very end. – Felix Marin Aug 24 '16 at 3:21
• @FelixMarin thanks sir ^_^ – user354387 Aug 24 '16 at 9:59
• @RefaatM.Sayed You're welcome. Sometimes I'm struggling along an answer to find the final result. It motivated my previous comment. _ – Felix Marin Aug 24 '16 at 19:37

Note

\begin{align}&\int^{\frac{\pi }{4} }_{0}\ln( 1+\tan x )\ dx =\frac12 \int^{\frac{\pi }{4} }_{0}\ln( 1+\tan x )^2\ dx\\ =& \frac12 \int^{\frac{\pi }{4} }_{0}\ln\sec^2x\ dx + \frac12 \int^{\frac{\pi }{4} }_{0}\underset{2x\to \frac\pi2-2x}{\ln(1+\sin2x)\ dx}\\ = &\frac12 \int^{\frac{\pi }{4} }_{0}\ln(\sec^2x(1+\cos2x))\ dx =\frac12 \int^{\frac{\pi }{4} }_{0}\ln2\ dx=\frac\pi8\ln2 \end{align}

The post asks for a hint, but that was quite a while ago. For the sake of the site, I think a full answer might be useful: \begin{align} &\int_0^{\pi/4}\log(1+\tan(x))\,\mathrm{d}x\\ &=\int_0^{\pi/4}\log(\cos(x)+\sin(x))\,\mathrm{d}x-\int_0^{\pi/4}\log(\cos(x))\,\mathrm{d}x\tag1\\ &=\int_0^{\pi/4}\log(\sqrt2\cos(\pi/4-x))\,\mathrm{d}x-\int_0^{\pi/4}\log(\cos(x))\,\mathrm{d}x\tag2\\ &=\frac\pi8\log(2)+\int_0^{\pi/4}\log(\cos(x))\,\mathrm{d}x-\int_0^{\pi/4}\log(\cos(x))\,\mathrm{d}x\tag3\\[6pt] &=\frac\pi8\log(2)\tag4 \end{align} Explanation:
$$(1)$$: $$1+\tan(x)=\frac{\cos(x)+\sin(x)}{\cos(x)}$$
$$(2)$$: $$\cos(x)+\sin(x)=\sqrt2\cos(\pi4-x)$$
$$(3)$$: integrate the constant $$\log(\sqrt2)$$
$$\phantom{\text{(3):}}$$ substitute $$x\mapsto\pi/4-x$$ in the left integral
$$(4)$$: cancel

• I looked before posting, but didn't find this answer, which, although is not the same, can be easily manipulated to be the same. – robjohn Sep 10 at 17:43