Integration of $\ln(1+\tan(x))$. How can I integrate
$$\int_{0}^{\frac{\pi}{2}}\ln\left(1+\tan(x) \right))dx?$$
I can integrate
$$\int_{0}^{\frac{\pi}{4}}(\ln(1+\tan(x)) dx = \frac{\pi}{8} \ln(2).$$
However the technique can not be used when the integrand from $0$ to $\frac{\pi}{2}.$
Any advice would be appreciate. Have a good day.
 A: Split the range and utilize the known integral
\begin{align}
I=&\int_{0}^{\frac{\pi}{4}}\ln(1+\tan x) dx
 + \int_{\frac{\pi}{4}}^{\frac\pi2}\ln(1+\tan x) \overset{x\to\frac\pi2-x}{dx}\\
=& \ 2\int_{0}^{\frac{\pi}{4}}\ln(1+\tan x) dx
 - \int_{0}^{\frac{\pi}{4}}\ln(\tan x)dx
=\frac\pi4\ln2 + G
\end{align}
A: Consider $$I(a)=\int_{0}^{\frac{\pi}{2}}\log\left(1+a\tan(x) \right))\,dx$$
$$I'(a)=\int_{0}^{\frac{\pi}{2}}\frac{\tan (x)}{a \tan (x)+1}\,dx=\int_{0}^{\frac{\pi}{2}}\frac{\sin (x)}{a \sin (x)+\cos (x)}\,dx$$ which does not present any difficulties. So
$$I'(a)=\frac{\pi  a-2 \log (a)}{2 a^2+2}=\frac \pi 4 \frac{2a}{a^2+1}-\frac {\log(a)}{a^2+1}$$
$$I(a)=\int_0^1 I'(a)\,da=\frac{1}{4} \pi  \log (2)+C$$
A: The following solution is a generalization to Cornel's solution:  With $\tan x=t$, we get
\begin{gather*}
 \int_0^\frac{\pi}{2}\ln^a(1+\tan x)\mathrm{d}x=\int_0^\infty\frac{\ln^a(1+t)}{1+t^2}\mathrm{d}t\\
\overset{t=1/y}=\int_0^\infty\frac{\ln^a\left(\frac{1+y}{y}\right)}{1+y^2}\mathrm{d}y\\
 \overset{y/(1+y)=x}{=}(-1)^a\int_0^1\frac{\ln^a(x)}{x^2+(1-x)^2}\mathrm{d}x\\
\left\{\text{write $\frac{1}{x^2+(1-x)^2}=\mathfrak{J} \frac{1+i}{1-(1+i)x}$}\right\}\\
 =(-1)^a \mathfrak{J} \int_0^1\frac{(1+i)\ln^a(x)}{1-(1+i)x}\mathrm{d}x\\
=a!\ \mathfrak{J}\,\operatorname{Li}_{a+1}(1+i)
 \end{gather*}
where the last step follows from using the integral form of the polylogarithm function:
$$\operatorname{Li}_{a+1}(z)=\frac{(-1)^a}{a!}\int_0^1\frac{z\ln^{a}(t)}{1-zt}\mathrm{d}t.$$

Bonus:
$$ \int_0^\frac{\pi}{4}\ln^a(1+\tan x)\mathrm{d}x=a!\,\mathfrak{J}\left[\operatorname{Li}_{a+1}(1+i)-\sum_{k=0}^a\frac{\ln^{a-k}(2)}{(a-k)!}\operatorname{Li}_{k+1}\left(\frac{1+i}2\right)\right]$$
