Integral $T_n=\int_{0}^{\pi/2}x^{n}\ln(1+\tan x)\,dx$

A closed form for $T_n$ is $$T_n=\frac{\log{2}}{2(n+1)}\Big(\frac{\pi}{2}\Big)^{n+1} -\frac{n!}{2^{n+1}}\Big(\sum_{m=0}^n \frac{(\pi/2)^{n-m}}{(n-m)!}(1+(-1)^m)\sum_{k=0}^m \frac{(\pi/2)^{m-k}}{(m-k)!}(-1)^k\,d_k $$ $$ - \sum_{m=0}^n \frac{\pi^{n-m}}{(n-m)!}\sin{(\pi\,m/2)}\zeta(m+2)\,+\, \sin{(\pi\,n/2)}\text{Li}_{n+2}(-1)\, \Big)$$ where $$ d_k=\cos{(\pi\,k/2)}\Big(\frac{\psi^{(k+1)}(3/4) - \psi^{(k+1)}(1/4)}{2^{2k+4}(k+1)!} \Big)-\sin{(\pi\,k/2)}\,2^{-(k+2)}\, \text{Li}_{k+2}(-1).$$ The $\psi^{(k)}(x)$ are the derivatives of the polygamma function and $\text{Li}_{k}(x)$ is the polylogarithm. At argument -1 we know $$\text{Li}_{k+2}(-1)=-(1-2^{-(k+1)})\zeta(k+2).$$

As it is written it is easy to see that we break out of the class of zeta-evaluated-at-integers. For even $k$ the first term in the $d_k$ is all that remains and in fact $d_0=-G,$ where $G$ is Catalan's constant. I haven't worked with Clausen functions, but I suspect there is a way to relate the OP's relation to mine by using them.

The solution turns on the trigonometric identity $ 1+\tan(x) = \sqrt{2}\,\sec(x)\,\sin{(x+\pi/4)}. $

Inserting and separating logs, $$ T_n = \int_0^{\pi/2} x^n \log\Big(\frac{2 \sin(x+\pi/4)}{2 \cos(x) }\Big)\,dx + \frac{\log{2}}{2}\int_0^{\pi/2} x^n \, dx $$ $$ = -\underbrace{\int_0^{\pi/2} x^n \log{(2\cos{x})}\,dx}_{I_n} \,+\,\underbrace{\int_0^{\pi/2} x^n \log{(2\sin(x+\pi/4))}\,dx}_{K_n} + \frac{\log{2}}{2(n+1)}\Big(\frac{\pi}{2}\Big)^{n+1} $$

$K_n$ has some similarities with $I_n$ so let's do a few manipulations first:

$$K_n = \int_{-\pi/4}^{\pi/4}(x+\pi/4)^n\log{(2 \cos{x})}\,dx = \sum_{m=0}^n (1+(-1)^m) \binom{n}{m} \Big(\frac{\pi}{4}\Big)^{n-m} \underbrace{\int_0^{\pi/4} x^n \log{(2\cos{x})}\,dx}_{J_m} $$ The difference between $I_n$ and $J_n$ is the upper limits of $\pi/2$ and $\pi/4$, respectively. The key fact used is the Fourier expansion $$\log(2\cos{x})=\sum_{k=1}^\infty \frac{(-1)^{k-1}}{k} \cos{(2k\,x)}$$

Let's work with $J_n$ first. The first step is scaling, the second is inserting the Fourier expansion, the third is writing in an equivalent form, and the fourth is setting up for using an operator method: $$ J_n = 2^{-(n+1)}\int_0^{\pi/2} x^n \log{(2 \cos{(x/2)})}\,dx =2^{-(n+1)} \sum_{k=1}^\infty \frac{(-1)^{k-1}}{k} \int_0^{\pi/2} x^n \cos{(k\,x)}\,dx$$ $$=2^{-(n+1)}\sum_{k=1}^\infty \frac{(-1)^{k-1}}{k}Re\Big[ \int_0^{\pi/2} x^n \exp{(i\,k\,x)}\,dx\Big]=$$ $$=2^{-(n+1)}\sum_{k=1}^\infty \frac{(-1)^{k-1}}{k}Re\Big[ \big(-i \frac{d}{dk}\big)^n \int_0^{\pi/2} \exp{(i\,k\,x)}\,dx\Big] $$ $$=2^{-(n+1)}\sum_{k=1}^\infty \frac{(-1)^{k}}{k}Re\Big[ i \big(-i \frac{d}{dk}\big)^n \frac{ \exp{(i\,k\,x)}}{k}\,\Big|_{x=0}^{\pi/2} \,\Big] $$ Write $\bar{J}_n = 2^{n+1}J_n$ for simplicity. Tautologically, where $[u^n]$ denotes the 'coefficient of' operator, $$\bar{J}_n = n!\,[u^n]\sum_{n=0}^\infty \frac{u^n}{n!} \bar{J}_n .$$ Use this and switch the $k$ and $n$ summations to find $$ \bar{J}_n = n!\,[u^n] \,Re\Big[ i \sum_{k=1}^\infty \frac{(-1)^{k}}{k} \Big( \sum_{n=0}^\infty \frac{u^n}{n!} \big(-i \frac{d}{dk}\big)^n \Big) \frac{ \exp{(i\,k\,x)}}{k}\,\Big|_{x=0}^{\pi/2}\, \Big]$$ The sum in the big parentheses is an exponential. Now use the well-known operator formula $ \exp(a\frac{d}{dx}) = f(x+a).$ $$\bar{J}_n = n! [u^n]\,Re\Big[ i \sum_{k=1}^\infty \frac{(-1)^{k}}{k} \frac{ \exp{(i\,(k-iu)\,x)}}{k-iu}\,\Big|_{x=0}^{\pi/2}\, \Big]$$ $$= - n!\,[u^n] \,Im\Big[ e^{u\,\pi/2} \sum_{k=1}^\infty \frac{(-i)^{k}}{k(k-iu)} - \sum_{k=1}^\infty \frac{(-1)^{k}}{k(k-iu)} \Big]$$ It is easy to prove by geometric expansion of $1/(k+a)$ and interchanging summations that $$ \sum_{k=1}^\infty \frac{x^k}{k(k+a)}=\sum_{k=0}^\infty (-a)^k \text{Li}_{k+2}(x).$$ Essentially, a partial fraction expansion has been turned into a power series. We have 2 sums of this form. In one sum you'll end up wth expressions like $Im[ (-i)^k$Li$_{k+2}(-i)].$ Thus we need the expansion

$$\text{Li}_{k+2}(-i)(-i)^k = i\cos{(\pi\,k/2)}\Big(\frac{\psi^{(k+1)}(3/4) - \psi^{(k+1)}(1/4)}{2^{2k+4}(k+1)!} \Big) - (\cos{(\pi\,k/2)}-i \sin{(\pi\,k/2)}) (1-2^{-(k+1)})\frac{\zeta(k+2)}{2^{k+2}}+ \frac{1}{2} \frac{E_{k+1}}{(k+1)!}\big( \frac{\pi}{2} \big)^{k+2}. $$

The $E_k$ are the Euler numbers.

The non-obvious steps of the proof have been shown. The remainder is doing the Cauchy products and extracting the coefficient of $u.$ For the expression $I_n,$ it's even easier because the upper limit of the integration is $\pi,$ so you end up with entirely real arguments for the polylogarithm. Some simplification has been performed to get the final answer, but without going through the details it's easy to see why the answer has the structure it does (e.g., double sum).


Below is somewhat different way to tackle this problem.

$$T_n=\frac{\pi^{n+1}\ln2}{(n+1)2^{n+2}}+\int_{0}^{\pi/2}x^{n}\ln\sin( x+\frac{\pi}{4})\,dx-\int_{0}^{\pi/2}x^{n}\ln\cos x\,dx$$

Three basic formulas follow

Fourier series : $$\ln \sin x=-\ln2-\sum_{k=1}^{\infty}\frac{\cos 2kx}{k};\,0<x<\pi$$

$$\ln \cos x=-\ln2+\sum_{k=1}^{\infty}(-1)^{k-1}\frac{\cos 2kx}{k};\,-\frac{\pi}{2}<x<\frac{\pi}{2}$$

and $$\int x^k\cos x\,dx =\sum_{\nu=0}^{k}\nu!\binom{k}{\nu}x^{k-\nu}\sin (x+\frac{\nu\pi}{2})$$

This last formula can be obtained by integration by parts.

The rest is to use $T_n$, these 3 formulas, elementary integration and summation procedures.

I'm not going to produce these calculations here because they don't add anything new (no clever tricks or something like) and are too lengthy.

Instead i write down the final result

$$T_n=f_0(n)+f_1(n)+f_2(n)+f_3(n)$$

where

$$f_0(n)=\frac{\pi^{n+1}\ln2}{(n+1)2^{n+2}}+\frac{n!\sin\frac{n\pi}{2}}{2^{n+1}}\left ( 1-\frac{1}{2^{n+1}} \right )\zeta (n+2)$$

$$f_1(n)=\frac{(-1)^n}{2}\left ( \frac{\pi}{4} \right )^n\sum_{k=0}^{n}(-1)^k\binom{n}{k}\sum_{\nu=0}^{k}(-1)^\nu(2\nu)!\binom{k }{2\nu}\left ( \frac{2}{\pi} \right )^{2\nu}\left (1+\frac{3^k}{3^{2\nu}} \right )\beta (2\nu+2)$$

$$f_2(n)=\frac{(-1)^n}{8}\left ( \frac{\pi}{4} \right )^n\sum_{k=0}^{n}(-1)^k\binom{n}{k}\sum_{\nu=0}^{k}(-1)^\nu(2\nu+1)!\binom{k }{2\nu+1}\left ( \frac{1}{\pi} \right )^{2\nu+1}\left (\frac{3^k}{3^{2\nu+1}}-1 \right )\left ( 1-\frac{1}{2^{2\nu+2}} \right )\zeta (2\nu+3)$$

$$f_3(n)=\frac{\pi^n}{2^{n+1}}\sum_{k=0}^{n}(-1)^k(2k+1)!\binom{n }{2k+1}\frac{\zeta (2k+3)}{\pi^{2k+1}}$$

where

$$\beta (m)=\sum_{k=0}^{\infty}\frac{(-1)^k}{(2k+1)^m}$$

is The Dirichlet beta function and

$$\zeta (m)=\sum_{k=1}^{\infty}\frac{1}{k^m}$$

is The Riemann zeta function

As an example let's compute $T_3$:

$$T_3=\frac{\pi^4}{128}\ln 2-\frac{93}{128}\zeta (5)-\frac{3\pi}{8}\beta (4)+\frac{105\pi^2}{512}\zeta (3)+\frac{\pi^3}{16}\beta (2)$$