definite integral of a trigonometric function with log $$I=\int_0^{\frac\pi 2} \log(1+\tan x)\,dx$$

I attempted it by substituting $(\frac\pi 2-x)$ as $x$ but we get $\log(1+\cot x)$ not sure how to proceed... and on adding $$2I=\log[(1+\tan x)(1+\cot x)]$$ 

 A: Hint. Consider the parametric integral
$$I(s)=\int_0^{\frac\pi 2} \log(1+s\tan x)\,dx$$
for $s\geq 0$, and the fact that
$$\int_{0}^{1} \frac{\log s}{1+s^{2}} \ ds =-G$$
where $G$ is the Catalan's constant.
Note that $I(0)=0$ and 
$$I'(s)=\int_0^{\frac\pi 2}\frac{\sin x}{\cos x+s\sin x}dx.$$
We find that
$$I'(s)=\frac{\pi s}{2(1+s^2)}-\frac{\log(s)}{1+s^2}.$$
Thus 
$$I=I(1)=\int_{0}^1 I'(s) ds=\frac{\pi\log(2)}{4}+G.$$
A: You can do it by substituting
$$\tan x = y - 1$$
$$\text{d}y = 1 + \tan^2 x\ \text{d}x ~~~~~ \to ~~~ \text{d}y = 1 + (y-1)^2 = (y^2 - 2y + 2)\ \text{d}x$$
And then 
$$\int_1^{+\infty} \frac{\log y}{y^2 - 2y + 2}\ \text{d}y = \mathbf{G} +\frac{1}{4}\pi\log(2)$$
Where $\mathbf{G}$ is the Catalan's constant.
A: Another solution using Clausen function
Start with $$ I=\int \limits^{\frac{\pi }{2} }_{0}\ln\left( 1+\tan \left( x\right) \right) dx=\overbrace{\int \limits^{\frac{\pi }{2} }_{0}\ln\left( \sin \left( x\right) +\cos \left( x\right) \right) dx} \limits^{I_{1}}-\overbrace{\int \limits^{\frac{\pi }{2} }_{0}\ln\left( \cos \left( x\right) \right) } \limits^{I_{2}}$$
$$ I_{1}=\int \limits^{\frac{\pi }{2} }_{0}\ln\left( \sin \left( x\right) +\cos \left( x\right) \right) dx=\int \limits^{\frac{\pi }{2} }_{0}\ln\left( \sqrt{2} \left( \sin \left( \frac{\pi }{4} \right) \cos \left( x\right) +\cos \left( \frac{\pi }{4} \right) \sin \left( x\right) \right) \right) dx= \frac{-\pi }{4} \ln\left( 2\right) +\int \limits^{\frac{\pi }{2} }_{0}\ln\left( 2\sin \left( x+\frac{\pi }{4} \right) \right) dx=\frac{-\pi }{4} \ln\left( 2\right) +\frac{1}{2} \int \limits^{\frac{3\pi }{2} }_{\frac{\pi }{2} }\ln\left( 2\sin \left( \frac{t}{2} \right) \right) dt=\frac{-\pi }{4} \ln\left( 2\right) -\frac{1}{2} \text{Cl}_{2}\left( \frac{3\pi }{2} \right) +\frac{1}{2} \text{Cl}_{2}\left( \frac{\pi }{2} \right) =\boxed {\frac{-\pi }{4} \text{ln}\left( 2\right) +G}$$ 
$$   I_{2}=\int \limits^{\frac{\pi }{2} }_{0}\ln\left( \cos \left( x\right) \right) dx=\int \limits^{\frac{\pi }{2} }_{0}\text{ln}\left( \sin \left( x\right) \right) dx $$ 
$$ 2I_{2}=\int \limits^{\frac{\pi }{2} }_{0}\text{ln}\left( \sin \left( 2x\right) \right) dx-\int \limits^{\frac{\pi }{2} }_{0}\text{ln}\left( 2\right) dx=\frac{1}{2} \int \limits^{\pi }_{0}\text{ln}\left( \sin \left( u\right) \right) du-\frac{\pi }{2} \text{ln}\left( 2\right) =\overbrace{\int \limits^{\frac{\pi }{2} }_{0}\text{ln}\left( \sin \left( u\right) \right) du} \limits^{I_{2}}-\frac{\pi }{2} \text{ln}\left( 2\right) $$
$$ I_{2}=\boxed {\frac{-\pi }{2} \text{ln}\left( 2\right)}$$
We have  $I=I_{1}-I_{2} $ to get the final result 
$$ \color{purple}{\boxed {I=  G+\frac{\pi }{4} \text{ln}\left( 2\right) } }$$
A: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
I & =
\color{#f00}{\int_{0}^{\pi/2}\ln\pars{1 + \tan\pars{x}}\,\dd x} =
\int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{x}}\,\dd x +
\int_{\pi/4}^{\pi/2}\ln\pars{1 + \tan\pars{x}}\,\dd x
\\[4mm] & =
\int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{x}}\,\dd x +
\int_{-\pi/4}^{0}\ln\pars{1 - \cot\pars{x}}\,\dd x
\\[5mm] &=
\int_{0}^{\pi/4}\ln\pars{1 + \tan\pars{x}}\,\dd x +
\int_{0}^{\pi/4}\ln\pars{1 + \cot\pars{x}}\,\dd x
\\[5mm] & =
\int_{0}^{\pi/4}\ln\pars{\bracks{1 + \tan\pars{x}}\bracks{1 + \cot\pars{x}}}
\,\dd x =
\int_{0}^{\pi/4}\ln\pars{2 + {2 \over 2\sin\pars{x}\cos\pars{x}}}\,\dd x
\\[5mm] & =
{1 \over 4}\,\ln\pars{2}\,\pi +\
\underbrace{\int_{0}^{\pi/4}\ln\pars{\cot\pars{x}}\,\dd x}
_{\ds{=\ G\,,\ \color{#f00}{\Large ?}}}\ +\
\underbrace{\int_{0}^{\pi/4}\ln\pars{{2\sin\pars{x}\cos\pars{x} + 1 \over 2\sin\pars{x}\cos\pars{x}}\,{1 \over \cot\pars{x}}}\,\dd x}_{\ds{=\ 0\,,\ \color{#f00}{\Large ??}}}
\\[5mm] & =
\color{#f00}{{1 \over 4}\,\ln\pars{2}\,\pi + G}
\end{align}

  
*
  
*$\ds{\color{#f00}{\Large ?}}$.
  
  $\ds{G = \int_{0}^{\pi/4}\ln\pars{\cot\pars{x}}\,\dd x}$ is a
  well known integral representation of the Catalan Constant $\ds{G}$.
  
*$\ds{\color{#f00}{\Large ??}}$.
  \begin{align}
\color{#f00}{\Large ??} & =
\int_{0}^{\pi/4}
\ln\pars{{2\sin\pars{x}\cos\pars{x} + 1 \over 2\cos^{2}\pars{x}}}\,\dd x =
\int_{0}^{\pi/4}
\ln\pars{{\sin\pars{2x} + 1 \over \cos\pars{2x} + 1}}\,\dd x
\\[5mm] & =
{1 \over 2}\int_{0}^{\pi/2}
\ln\pars{{\sin\pars{x} + 1 \over \cos\pars{x} + 1}}\,\dd x
\\[5mm] & =
\underbrace{{1 \over 2}\int_{0}^{\pi/2}
\ln\pars{{\cos\pars{x} + 1 \over \sin\pars{x} + 1}}\,\dd x}
_{\ds{=\ -\color{#f00}{\Large ??}}}\quad\implies\quad
\bbox[8px,#efe,border:0.1em groove navy]{\color{#f00}{\Large ??} = 0}
\end{align}
  

