<s>[INST] Do we have a closed form for $\int_0^{\infty} \frac{\ln t}{\left(1+t^2\right)^n} d t $? Latest Edit
We are glad to see there are 4 alternative solutions which give the same closed form to the integral:
$$\boxed{\int_0^{\infty} \frac{\ln t}{\left(a^2+t^2\right)^n} d t = \frac{a^{1-2n}\sqrt{\pi}\Gamma\left(n-\frac{1}{2}\right)}{4\Gamma(n)}\left[2\ln a+\psi\left(\frac{1}{2}\right)-\psi\left(n-\frac{1}{2}\right)\right] },$$
where $\psi$ denotes the Digamma Function.


In the post, we found that
$$\int_0^{\infty} \frac{\ln x}{a^2+t^2} d x =\frac{\pi \ln a}{2 a }$$
Now I want to generalise the integral as
$$
I_n=\int_0^{+\infty} \frac{\ln t}{\left(a+t^2\right)^n} d t
$$
where $n\in N$.
Replacing a by $\sqrt{a}$ and differentiating both sides w.r.t. $a$ by $n$ times yields
$$
\begin{aligned}
&J(a)=\int_0^{\infty} \frac{\ln t}{a+t^2} d t=\frac{\pi}{4 \sqrt{a}} \ln a\\
&\frac{d^n}{d a^n}(J(a))=\frac{\pi}{4} \frac{d^n}{d a^n}\left(\frac{\ln a}{\sqrt{a}}\right) \\ & (-1)^n n ! \int_0^{\infty} \frac{\ln t}{\left(a+t^2\right)} d t= \frac{\pi}{4} \frac{d^n}{d a^n}\left(\frac{\ln a}{\sqrt{a}}\right)\\& \boxed{\int_0^{\infty} \frac{\ln t}{\left(a+t^2\right)^{n+1}} d t=\frac{(-1)^n \pi}{4 n !} \frac{d^n}{d a^n}\left(\frac{\ln a}{\sqrt{a}}\right)}
\end{aligned}
$$
By Wolfram-alpha, we have
$$
\frac{d^n}{d a^n}\left(\frac{\ln a}{\sqrt{a}}\right)=(-1)^n a^{-\frac{1}{2}-n}\left(\frac{1}{2}\right)_n\left(\ln a+\psi\left(\frac{1}{2}\right)-\psi\left(\frac{1}{2}-n\right)\right)\cdots (*)
$$
Hence
$$\boxed{\int_0^{\infty} \frac{\ln t}{\left(a+t^2\right)^{n+1}} d t=\frac{\pi}{4 n !} a^{-\frac{1}{2}-n}\left(\frac{1}{2}\right)_n\left(\ln a+\psi\left(\frac{1}{2}\right)-\psi\left(\frac{1}{2}-n\right)\right)}$$
In particular, when $a=1$, we have
$$\boxed{\int_0^{\infty} \frac{\ln t}{\left(1+t^2\right)^{n+1}} d t=\frac{\pi}{4 n !} \left(\frac{1}{2}\right)_n\left(\psi\left(\frac{1}{2}\right)-\psi\left(\frac{1}{2}-n\right)\right)}$$
For example,
$$$$
\begin{aligned}
\int_0^\infty \frac{\ln t}{\left(1+t^2\right)^4} d t=& \frac{\pi}{24} \cdot \frac{15}{8}\left(-\gamma -\ln 4-\frac{46}{15}+\gamma +\ln 4\right) 
=-\frac{23 \pi}{96}
\end{aligned}
$$
$$
My Question: How to find a closed form for $\frac{d^n}{d a^n}\left(\frac{\ln a}{\sqrt{a}}\right) $?
 [/INST] As @metamorphy suggested, let $I\left(\lambda\right)=\int_0^{\infty} \frac{t^{2 \lambda-1}}{\left(a^2+t^2\right)^n} d t,$ then
$$I_n=\int_0^{\infty} \frac{\ln t}{\left(a^2 +t^2\right)^n} d t= \frac{1}{2} I^{\prime}\left(\frac{1}{2}\right) .$$
Now we are going to express $I\left(\lambda\right)$ as a beta function by letting $t=a\tan \theta$, then
$$
\begin{aligned}
I(\lambda) &= a^{2(\lambda-n)}\int_0^{\frac{\pi}{2}} \sin ^{2 \lambda-1} \theta \cos ^{2(n-\lambda)-1} \theta d \theta \\
&=\frac{a^{2(\lambda-n)}}{2} B(\lambda, n-\lambda) \\
&=\frac{a^{2(\lambda-n)}}{2\Gamma(n) } \Gamma(\lambda) \Gamma(n-\lambda)
\end{aligned}
$$
By logarithmic differentiation, we get
$$
\begin{aligned}
&\frac{I^{\prime}(\lambda)}{I(\lambda)}=2\ln a+\psi(\lambda)-\psi(n-\lambda) \\
&I^{\prime}(\lambda)=\frac{a^{2(\lambda-n)}}{2 \Gamma(n)} \Gamma(\lambda) \Gamma(n-\lambda)[ 2\ln a+\psi(\lambda)-\psi(n-\lambda)]
\end{aligned}
$$
Putting $\lambda=\frac{1}{2} $ yields
$$
I^{\prime}\left(\frac{1}{2}\right)=\frac{a^{1-2n}\sqrt{\pi}}{2} \cdot \frac{\Gamma\left(n-\frac{1}{2}\right)}{\Gamma(n)}\left[2\ln a+\psi\left(\frac{1}{2}\right)-\psi\left(n-\frac{1}{2}\right)\right]
$$
Hence $$\boxed{\int_0^{\infty} \frac{\ln t}{\left(a^2+t^2\right)^n} d t= \frac{1}{2} I^{\prime}\left(\frac{1}{2}\right) = \frac{a^{1-2n}\sqrt{\pi}\Gamma\left(n-\frac{1}{2}\right)}{4\Gamma(n)}\left[2\ln a+\psi\left(\frac{1}{2}\right)-\psi\left(n-\frac{1}{2}\right)\right] },$$
which is same as the answer provided by @Felix Marin.
Back to our integral,
$$\boxed{\int_0^{\infty} \frac{\ln t}{\left(1+t^2\right)^n} d t= \frac{1}{2} I^{\prime}\left(\frac{1}{2}\right) = \frac{\sqrt{\pi}\Gamma \left(n-\frac{1}{2}\right)}{4\Gamma(n)}\left[\psi\left(\frac{1}{2}\right)-\psi\left(n-\frac{1}{2}\right)\right] }$$
By Wolfram-Alpha, $\psi\left(\frac{1}{2}\right)-\psi\left(n-\frac{1}{2}\right) = -H_{n-\frac{3}{2}}-2 \log (2) $ yields
$$I_n= -\frac{\sqrt{\pi}\Gamma\left(n-\frac{1}{2}\right)}{4\Gamma(n)}\left(H_{n-\frac{3}{2}}+2\ln 2\right),$$
which is the same as the answer provided by @Claude Leibovici.
</s>