TITLE: How do we find the exact value of $\int_{0}^{\infty} \frac{\ln ^{n}\left(1+x^{2}\right)}{1+x^{2}} d x$, where $n\in \mathbb N?$
QUESTION [10 upvotes]: In my post, I started to evaluate $$I_1=\int_{0}^{\infty} \frac{\ln \left(1+x^{2}\right)}{1+x^{2}} d x =\pi \ln 2, $$
then I challenge myself on $$I_2=\int_{0}^{\infty} \frac{\ln ^{2}\left(1+x^{2}\right)}{1+x^{2}}dx$$
Again, letting $x=\tan \theta$ as for $I_1$ yields$$I_2=\int_{0}^{\frac{\pi}{2}} \ln ^{2}\left(\sec ^{2} \theta\right) d \theta= 4 \int_{0}^{\frac{\pi}{2}} \ln ^{2}(\cos x) dx $$
It’s very hard to deal with $\ln^2$ and I was stuck. uddenly a wonderful identity came to my mind. $$
2\left(a^{2}+b^{2}\right)=(a+b)^{2}+(a-b)^{2},
\\$$
by which
$\displaystyle 2\left[\ln ^{2}(\sin x)+\ln ^{2}(\cos x)\right]=[\ln (\sin x)+\ln (\cos x)]^{2}+[\ln (\sin x)-\ln (\cos x)]^{2} ,\tag*{}\\ $
we have
$\displaystyle 4 L=\underbrace{\int_{0}^{\frac{\pi}{2}} \ln ^{2}\left(\frac{\sin 2 x}{2}\right)}_{J} d x+\underbrace{\int_{0}^{\frac{\pi}{2}} \ln ^{2}(\tan x) d x}_{K} \tag*{}\\ $
For the first integral, using $ \int_{0}^{\frac{\pi}{2}} \ln (\sin x) d x=-\dfrac{\pi}{2} \ln 2 $ yields
$ \begin{aligned}J &=\int_{0}^{\frac{\pi}{2}}[\ln (\sin 2 x)-\ln 2]^{2} d x \\&=\int_{0}^{\frac{\pi}{2}} \ln ^{2}(\sin 2 x) d x-2 \ln 2 \int_{0}^{\frac{\pi}{2}} \ln (\sin 2 x) d x +\frac{\pi \ln ^{2} 2}{2} \\& \stackrel{x\mapsto 2x}{=} \frac{1}{2} \int_{0}^{\pi} \ln ^{2}(\sin x) d x-\ln 2 \int_{0}^{\pi} \ln (\sin x) d x+\frac{\pi \ln ^{2} 2}{2} \\& \stackrel{symmetry}{=} L-\ln 2(-\pi \ln 2)+\frac{\pi \ln ^{2} 2}{2} \\&=L+\frac{3 \pi \ln ^{2} 2}{2}\end{aligned}\tag*{} \\$
For the second integral, letting $ y=\tan x $ and using my post yields
$ \displaystyle K=\int_{0}^{\infty} \frac{\ln ^{2} y}{1+y^{2}} d y=\frac{\pi^{3}}{8}, \tag*{} \\$
then
$ \displaystyle 4L=L+\frac{3 \pi \ln ^{2} 2}{2}+\frac{\pi^{3}}{8} \Rightarrow L=\frac{\pi^{3}}{24}+\frac{\pi \ln ^{2} 2}{2}\tag*{} $
Hence
$ \displaystyle \boxed{I_2=4L= \frac{\pi^{3}}{6}+2 \pi \ln ^{2} 2} \tag*{} $
My Question: Can I go further with $I_n$, where $n\geq 3$?
Latest Edit
By Mr KStarGamer’s help, I can finally find a reduction formula for $I_n$ as below: $$\boxed{I_n= 2 \ln 2 I_{n-1}+ (n-1)!\sum_{k=0}^{n-2} \frac{2^{n-k}-2}{k!}\zeta(n-k)  I_k}
$$
where $n\geq 2.$

REPLY [4 votes]: Inspired by KStarGamer that $$
I(a):=\int_{0}^{\infty}\left(1+x^{2}\right)^{a} d x \Rightarrow \quad 
I^{\prime}(a)=\int_{0}^{\infty}\left(1+x^{2}\right)^{a} \ln \left(1+x^{2}\right) d x
$$
Consequently $$
\boxed{I_{n}=I^{(n)}(-1)},
$$
which switches the integration problem to a differentiation problem.
I first express $I(a)$ in terms of Gamma functions as KStarGamer said.
$$
\begin{aligned} I(a)&\stackrel{x=\tan \theta}{=} \int_{0}^{\frac{\pi}{2}} \sin ^{2\left(\frac{1}{2}\right)-1} \theta \cos ^{2\left(-a-\frac{1}{2}\right)-1} \theta d \theta\\& =\frac{1}{2} B\left(-a-\frac{1}{2}, \frac{1}{2}\right)\\&=\frac{\sqrt{\pi} \Gamma\left(-a-\frac{1}{2}\right)}{2 \Gamma(-a)}, \end{aligned}$$
By logarithmic differentiation,$$\frac{I^{\prime}(a)}{I(a)}=-\psi\left(-a-\frac{1}{2}\right)+\psi(-a)$$ $$
\boxed{I^{\prime}(a)= I(a)\left[ \psi(-a)-\psi\left(-a-\frac{1}{2}\right)\right]\cdots (*)}
$$
where $\psi(z)=\frac{d}{d z}[\ln \Gamma(z)]$.
Using Leibniz Rule, differentiating both sides in (*) w.r.t. $a$ by $n-1$ times followed by putting $a=-1$ yields $$
I^{(n)}(-1)=\sum_{k=0}^{n-1} (-1)^{n-k-1}\left(\begin{array}{c}
n-1 \\
k
\end{array}\right) I^{(k)}(-1)\left[\psi^{(n-k-1)}(1)-\psi^{(n-k-1)}\left(\frac{1}{2}\right)\right]
$$
which is a reduction formula involving Polygamma function $\psi(\cdot).$
Converting the formula back to our integral $I_n=I^{(n)}(-1) $,
$$
\boxed{I_n=\sum_{k=0}^{n-1} (-1)^{n-k-1}\left(\begin{array}{c}
n-1 \\
k
\end{array}\right) I_k\left[\psi^{(n-k-1)}(1)-\psi^{(n-k-1)}\left(\frac{1}{2}\right)\right]}
$$
Let’s try with the initial $I_0=I^{(0)}(-1)=\frac{\pi}{2}$, applying (*) yields $$
I_{1}=I_0\left[\psi(1)-\psi\left(\frac{1}{2}\right)\right]=\frac{\pi}{2} \ln 4=\pi \ln 2
$$ $$
\begin{aligned}
I_2=&-\left(\begin{array}{l}
1 \\
0
\end{array}\right) I_0\left[\psi^{\prime}(1)-\psi^{\prime}\left(\frac{1}{2}\right)\right] +\left(\begin{array}{l}
1 \\
1
\end{array}\right) I_1\left[\psi(1)-\psi\left(\frac{1}{2}\right)\right] \\
\end{aligned}
$$
Hence $$\int_{0}^{\infty} \frac{\ln ^2\left(1+x^{2}\right)}{1+x^{2}} d x= -\frac{\pi}{2}\left(-\frac{\pi^{2}}{3}\right)+\pi \ln 2 \ln 4= \frac{\pi^{3}}{6}+2 \pi \ln ^{2} 2$$
Furthermore $$
\begin{aligned}
\int_{0}^{\infty} \frac{\ln ^{3}\left(1+x^{2}\right)}{1+x^{2}} =&\left(\begin{array}{l}
2 \\
0
\end{array}\right) I_0\left[\psi^{(2)}(1)-\psi^{(2)}\left(\frac{1}{2}\right)\right] \\
&-\left(\begin{array}{l}
2 \\
1
\end{array}\right) I_1\left[\psi^{(1)}(1)-\psi^{(1)}\left(\frac{1}{2}\right)\right] \\
&+\left(\begin{array}{l}
2 \\
2
\end{array}\right) I_2\left[\psi(1)-\psi\left(\frac{1}{2}\right)\right] \\
=&\frac{\pi}{2}(12)\zeta(3)-2 \pi \ln 2\left(-\frac{\pi^{2}}{3}\right)+\left(\frac{\pi^{3}}{6}+2 \pi \ln ^{2}2\right) \ln 4 \\
=& 6 \pi \zeta(3)+\pi^{3} \ln 2+4 \pi \ln ^{3} 2 
\end{aligned}
$$
Though we can find the integral $I_n=\int_{0}^{\infty} \frac{\ln ^{n}\left(1+x^{2}\right)}{1+x^{2}}$ one by one by the reduction formula, it is hard to find $$
\boxed{\psi^{(n)}(1)-\psi^{(n)}\left(\frac{1}{2}\right)\textrm{ where }n\geq 2},
$$
which is guessed to be $r\zeta(n+1)$ for some real number $r$?
Your help will be highly appreciated.
Latest Edit
Being reminded by KStarGamer that
$$
\psi^{(n)}(1)-\psi^{(n)}\left(\frac{1}{2}\right)=(-1)^{n} n !\left(2^{n+1}-2\right)\zeta(n+1) \tag*{(**)} 
$$
I can now finally conclude that
$$\boxed{I_n= 2 \ln 2 I_{n-1}+ (n-1)!\sum_{k=0}^{n-2} \frac{2^{n-k}-2}{k!}\zeta(n-k)  I_k}
$$
where $n\geq 1.$
For completeness, I tried to prove the identity (**) by the series representation of Polygamma  Function:
$$
\psi^{(n)}(z)=(-1)^{n+1} n ! \sum_{k=0}^{\infty} \frac{1}{(z+k)^{n+1}}  
$$$$
\begin{aligned}
\psi^{(n)}(1) &=(-1)^{n+1} n ! \sum_{k=0}^{\infty} \frac{1}{(1+k)^{n+1}} \\
&=(-1)^{n+1} n ! \zeta(n+1)
\end{aligned}
$$
$$
\begin{aligned}
\psi^{(n)}\left(\frac{1}{2}\right) &=(-1)^{n+1} n ! \sum_{k=0}^{\infty} \frac{1}{\left(\frac{1}{2}+k\right)^{n+1}} \\
&=(-1)^{n+1} n ! 2^{n+1} \sum_{k=0}^{\infty} \frac{1}{(2 k+1)^{n+1}}\\&= (-1)^{n+1} n !\left(2^{n+1}-1\right) \zeta(n+1)
\end{aligned}
$$
Hence $$
\psi^{(n)}(1)-\psi^{(n)}\left(\frac{1}{2}\right)=(-1)^{n} n !\left(2^{n+1}-2\right)\zeta(n+1) 
$$