Evaluate $\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n}} d x$. Latest Edit
By the contributions of the writers, we finally get the closed form for the integral as:
$$\boxed{\int_{0}^{\infty} \frac{\ln x}{(x^{2}+1)^n} d x =-\frac{\pi(2 n-3) ! !}{2^{n}(n-1) !} \sum_{j=1}^{n-1} \frac{1}{2j-1}}$$

I first evaluate $$I_1=\int_{0}^{\infty} \frac{\ln x}{x^{2}+1} d x \stackrel{x\mapsto\frac{1}{x}}{=}  -I_1 \Rightarrow I_1= 0.$$
and then start to raise up the power of the denominator
$$I_n=\int_{0}^{\infty} \frac{\ln x}{(x^{2}+1)^n} d x .$$
In order to use differentiation, I introduce a more general integral
$$I_n(a)=\int_{0}^{\infty} \frac{\ln x}{(x^{2}+a)^n} d x. $$
Now we can start with $I_1(a)$. Using $I_1=0$ yields
$$\displaystyle  1_1(a)=\int_{0}^{\infty} \frac{\ln x}{x^{2}+a} d x \stackrel{x\mapsto\frac{x}{a}}{=} \frac{\pi \ln a}{4 \sqrt a} \tag*{}$$
Now we are going to deal with $I_n$ by differentiating it by $(n-1)$ times
$$
\frac{d^{n-1}}{d a^{n-1}} \int_{0}^{\infty} \frac{\ln x}{x^{2}+a} d x=\frac{\pi}{4} \frac{d^{n-1}}{d a^{n-1}}\left(\frac{\ln a}{a}\right)
$$
$$
\int_{0}^{\infty} \ln x\left[\frac{\partial^{n-1}}{\partial a^{n-1}}\left(\frac{1}{x^{2}+a}\right)\right] d x=\frac{\pi}{4} \frac{d^{n-1}}{d a^{n-1}}\left(\frac{\ln a}{\sqrt a}\right)
$$
$$
\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+a\right)^{n}} d x=\frac{(-1)^{n-1} \pi}{4(n-1) !} \frac{d^{n-1}}{d a^{n-1}}\left(\frac{\ln a}{\sqrt{a}}\right)
$$
In particular, when $a=1$, we get a formula for $$
\boxed{\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n}} d x=\left.\frac{(-1)^{n-1} \pi}{4(n-1)!} \frac{d^{n-1}}{d a^{n-1}}\left(\frac{\ln a}{\sqrt{a}}\right)\right|_{a=1}}
$$
For example, $$
\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{5}} d x=\frac{\pi}{4 \cdot 4 !}(-22)=-\frac{11 \pi}{48}
$$
and
$$
\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{10}} d x=\frac{-\pi}{4(9 !)}\left(\frac{71697105}{256}\right)=-\frac{1593269 \pi}{8257536}
$$
which is check by WA.
MY question
Though a formula for $I_n(a)$ was found, the last derivative is hard and tedious.
Is there any formula for $$\frac{d^{n-1}}{d a^{n-1}}\left(\frac{\ln a}{\sqrt{a}}\right)? $$
 A: The derivative can be taken using the product rule: $$\frac{d^n}{da^n}\frac{\ln a}{\sqrt{a}}=\sum_{k=0}^n\binom{n}{k}\frac{d^k a^{-1/2}}{da^k}\frac{d^{n-k}\ln a}{da^{n-k}}$$ together with $\dfrac{d^k a^\lambda}{da^k}=k!\dbinom{\lambda}{k}a^{\lambda-k}$ and $\dfrac{d^k\ln a}{da^k}=\dfrac{d^{k-1}a^{-1}}{da^{k-1}}$ for $k>0$.

Another way to evaluate the given integral is as follows: $$I_n=\int_0^\infty\frac{\ln x\,dx}{(x^2+1)^n}=\frac14 F_n'\left(\frac12\right),\quad F_n(\alpha)=2\int_0^\infty\frac{x^{2\alpha-1}\,dx}{(x^2+1)^n},$$ and the last integral is evaluated using the beta function $$F_n(\alpha)=\mathrm{B}(\alpha,n-\alpha)=\frac1{(n-1)!}\frac{\pi}{\sin\alpha\pi}\prod_{k=1}^{n-1}(k-\alpha),$$ so that $F_n'(\alpha)/F_n(\alpha)$ is obtained easily, and we get $$I_n=-\frac{\pi}{4}\binom{n-3/2}{n-1}\sum_{k=1}^{n-1}\frac1{k-1/2}=-\frac{\pi}{2}\frac{(2n-3)!!}{(2n-2)!!}\sum_{k=1}^{n-1}\frac1{2k-1}.$$
A: Use $(a^x)’=a^x\ln a$ to evaluate
\begin{align}\frac{d^{n}}{d a^{n}}\left(\frac{\ln a}{\sqrt{a}}\right)_{a=1}
= &\frac{\partial^{n}}{\partial a^{n}}
\left(\frac{\partial a^x}{\partial x}\bigg|_{x=-\frac12}\right)_{a=1}
 =\frac{\partial}{\partial x}
\left(\frac{\partial^{n}a^x}{\partial a^{n}}\bigg|_{a=1}\right)_{x=-\frac12}\\
=& \frac{d}{dx}
\bigg(\prod_{k=1}^{n}(x-k+1)\bigg)_{x=-\frac12}
= \prod_{k=1}^{n}(\frac12-k)\sum_{j=1}^{n}\frac1{\frac12-j}\\
=&-\frac{(-1)^n (2n-1)!!}{2^{n-1}}
 \sum_{j=1}^{n}\frac1{2j-1}
\end{align}
Thus
$$
\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n+1}} d x=\frac{(-1)^{n} \pi}{4n!} \frac{d^{n}}{d a^{n}}\left(\frac{\ln a}{\sqrt{a}}\right)_{a=1}
 =-\frac{\pi(2n-1)!!}{2^{n+1}n!}
 \sum_{j=1}^{n}\frac1{2j-1}
$$
A: Inspired by metamorphy, I do want to try his wonderful trick
$$
I_{n}=\frac{1}{4} F^{\prime} _n\left(\frac{1}{2}\right) \text { where } F_{n}(\alpha)=2 \int_{0}^{\infty} \frac{x^{2 \alpha-1}}{\left(x^{2}+1\right)^{2}} d x
$$
In my post, I had found $$ \displaystyle \int_{0}^{\infty} \frac{x^{r} d x}{\left(x^{m}+a\right)^{n}}=\frac{\pi}{m(n-1) !} \csc \frac{(r+1) \pi}{m} \prod_{j=1}^{n-1}\left(j-\frac{r+1}{m}\right) a^{-\left(n-\frac{r+1}{m}\right)}\tag*{} $$
Replacing $m=2, r=2 \alpha-1 $ yields
$$
\begin{aligned}
F_{n}(\alpha) &=\frac{2 \pi}{2(n-1) !} \csc \left(\frac{2 \alpha \pi}{2}\right) \prod_{j=1}^{n-1}\left(j-\frac{2 \alpha}{2}\right) \\
&=\frac{\pi}{(n-1) !} \csc (\alpha \pi) \prod_{j=1}^{n-1}(j-\alpha)
\end{aligned}
$$
By logarithmic differentiontin, we get
$$
\frac{F_{n}^{\prime}(\alpha)}{F_{n}(\alpha)}=-\pi \cot (\alpha \pi)-\sum_{j=1}^{n-1}\left(\frac{1}{j-\alpha}\right)
$$
Putting $\alpha=\frac{1}{2}$ yields
$$
\begin{aligned}
F_{n}^{\prime}\left(\frac{1}{2}\right) &=-F_{n}\left(\frac{1}{2}\right) \sum_{j=1}^{n-1} \frac{1}{j-\frac{1}{2}} \\
&=-\frac{\pi}{(n-1) !} \prod_{j=1}^{n-1}\left(j-\frac{1}{2}\right) \sum_{j=1}^{n-1} \frac{1}{j-\frac{1}{2}}\\& =-\frac{\pi(2 n-3) ! !}{2^{n-2}(n-1) !} \sum_{j=1}^{n-1} \frac{1}{2j-1}
\end{aligned}
$$
Now we can conclude that
$$\boxed{I_n=-\frac{\pi(2 n-3) ! !}{2^{n}(n-1) !} \sum_{j=1}^{n-1} \frac{1}{2j-1}}$$
A: If you like hypergeometric functions, there is an antiderivative
$$J_n=\int\frac{\log(x)}{\left(x^{2}+a\right)^{n}}\,d x=\frac x {a^n} \left( \,
   _2F_1\left(\frac{1}{2},n;\frac{3}{2};-\frac{x^2}{a}\right) \log(x)-\,
   _3F_2\left(\frac{1}{2},\frac{1}{2},n;\frac{3}{2},\frac{3}{2};-\frac{x^2}{a}\right)
   \right)$$ So
$$K_n=\int_0^\infty\frac{\log(x)}{\left(x^{2}+a\right)^{n}}\,d x=-\frac{\sqrt{\pi }}{4}\,\frac{\Gamma \left(n-\frac{1}{2}\right)}{\Gamma (n)}\,\frac 1{a^{n-\frac{1}{2}}}\left(\log \left(\frac{4}{a}\right)+H_{n-\frac{3}{2}}\right)$$ and if $a= 1$
$$I_n=\int_0^\infty\frac{\log(x)}{\left(x^{2}+1\right)^{n}}\,d x=-\frac{\sqrt{\pi }}{4}\,\frac{\Gamma \left(n-\frac{1}{2}\right)}{\Gamma (n)}\,\left(H_{n-\frac{3}{2}}+2 \log (2)\right)$$
For large values of $n$
$$I_n \sim -\frac{\sqrt{\pi }}{4}\,\frac{\log (n)+\gamma +2 \log (2)}{\sqrt{n}}\Bigg[1+\frac{3 (\log (n)+ \gamma +2 \log (2))-8}{8 (\log (n)+\gamma +2 \log (2))}\,\frac 1 n +\cdots\Bigg]$$ which is quite accurate ($0.22$% relative error for $n=5$ and $0.0047$% for $n=10$).
A: Your integral can be expressed as the derivative of the complete beta function:
From Fubini-Tonelli we can interchange limit/derviative and integral:
$$I = \int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n}} d x = \int_{0}^{\infty} \frac{\left(\frac{d}{dt}\Big|_{t=0+} x^t\right)}{(x^2+1)^n}dx = \frac{d}{dt}\Big|_{t=0+} \int_{0}^{\infty} \frac{x^t}{(1+x^2)^n} dx $$
Recall the following integral representation of the complete Beta function:
$$ \int_{0}^{\infty} \frac{y^{a-1}}{(1+y)^{a+b}} dx = B(a,b)$$
If we let $x^2 = w$ then
$$ I = \frac{d}{dt}\Big|_{t=0+} \frac{1}{2}\int_{0}^{\infty} \frac{w^{\frac{t-1}{2}}}{(1+w)^n}dw  = \frac{d}{dt}\Big|_{t=0+} \frac{1}{2} B\left(\frac{t+1}{2},n-\frac{t+1}{2}\right)$$
Hence
$$\lim_{t \to 0+} \frac{d}{dt} \frac{1}{2}
B\left(\frac{t+1}{2},n-\frac{t+1}{2}\right) = \frac{1}{4}\left[ \psi\left(\frac{1}{2}\right) - \psi\left(n-\frac{1}{2}\right)\right]B\left(\frac{1}{2},n-\frac{1}{2}\right) $$
where $\psi(z)$ is the digamma function.
The right hand side can also be expressed as
$$I= -\frac{1}{4}\left[ H_{n-\frac{3}{2}} + \ln(4)\right]B\left(\frac{1}{2},n-\frac{1}{2}\right) $$
where $H_{x}$ is the Harmonic number
Hence
$$\boxed{\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n}} d x = \frac{1}{4}\left[ \psi\left(\frac{1}{2}\right) - \psi\left(n-\frac{1}{2}\right)\right]B\left(\frac{1}{2},n-\frac{1}{2}\right) = -\frac{1}{4}\left[ H_{n-\frac{3}{2}} + \ln(4)\right]B\left(\frac{1}{2},n-\frac{1}{2}\right)}$$
Using this formula
$$ \psi\left(\frac{1}{2}-J\right) = \psi\left(\frac{1}{2}+J\right) = -\gamma -\ln(4) + \sum_{j=1}^{J} \frac{2}{2j-1} \quad J=0,1,2...$$
$$\psi\left(\frac{1}{2}\right) = -\gamma -\ln(4)$$
$$\psi\left(n-\frac{1}{2}\right) = -\gamma -\ln(4) + \sum_{j=1}^{n-1} \frac{2}{2j-1} $$
Hence
$$ \left[ \psi\left(\frac{1}{2}\right) - \psi\left(n-\frac{1}{2}\right)\right] = -\sum_{j=1}^{n-1} \frac{2}{2j-1}$$
We have another form:
$$ \boxed{\int_{0}^{\infty} \frac{\ln x}{\left(x^{2}+1\right)^{n}} d x  = -\frac{1}{4}\sum_{j=1}^{n-1} \frac{2}{2j-1}B\left(\frac{1}{2},n-\frac{1}{2}\right) }$$
Similar to what other users found previously
A: Alternative solution:
Using the identity ($q > 0$)
$$
\frac{1}{q^n} = \frac{1}{\Gamma(n)}\int_0^\infty \mathrm{e}^{-qy}y^{n - 1}\mathrm{d} y,
$$
we have
\begin{align*}
 I_n &= \int_0^\infty \frac{\ln x}{(x^2 + 1)^n}\mathrm{d} x\\
 &= \int_0^\infty  \left( \frac{1}{\Gamma(n)}\int_0^\infty e^{-y(1 + x^2)}y^{n - 1}\mathrm{d}y \right) \ln x\, \mathrm{d} x \\
 &= \frac{1}{\Gamma(n)}\int_0^\infty \mathrm{e}^{-y} y^{n - 1}
 \left(\int_0^\infty \mathrm{e}^{-y x^2}\ln x \, \mathrm{d} x\right) \mathrm{d} y\\
 &= \frac{1}{\Gamma(n)}\int_0^\infty \mathrm{e}^{-y} y^{n - 1}
 \left( - \frac{(\gamma + \ln 4)\sqrt \pi}{4\sqrt y} - \frac{\sqrt{\pi}\ln y}{4\sqrt y} \right) \mathrm{d} y \\
 &= -\frac{(\gamma + \ln 4)\sqrt \pi}{4\Gamma(n)}\int_0^\infty \mathrm{e}^{-y} y^{n - 3/2}\mathrm{d} y - \frac{\sqrt{\pi}}{4\Gamma(n)}
 \int_0^\infty \mathrm{e}^{-y} y^{n - 3/2}\ln y \, \mathrm{d}y\\
 &= -\frac{(\gamma + \ln 4)\sqrt \pi}{4\Gamma(n)}\Gamma(n - 1/2) - \frac{\sqrt{\pi}}{4\Gamma(n)}\Gamma'(n - 1/2)\\
 &= -\frac{(\gamma + \ln 4)\sqrt \pi}{4\Gamma(n)}\Gamma(n - 1/2) - \frac{\sqrt{\pi}}{4\Gamma(n)} \psi(n - 1/2)\Gamma(n - 1/2)
\end{align*}
where $\psi(\cdot)$ is the digamma function defined by $\psi(u) = \frac{\mathrm{d} \ln \Gamma(u)}{\mathrm{d} u} = \frac{\Gamma'(u)}{\Gamma(u)}$,
and we have used
\begin{align*}
 &\int_0^\infty \mathrm{e}^{-y x^2}\ln x \, \mathrm{d} x\\
 =\,& \int_0^\infty \frac{1}{\sqrt y}\mathrm{e}^{-u^2}\ln \frac{u}{\sqrt y}\,\mathrm{d} u \\
 =\,& \frac{1}{\sqrt y}\int_0^\infty \mathrm{e}^{-u^2}\ln u \,\mathrm{d} u - \frac{\ln y}{2\sqrt y}\int_0^\infty \mathrm{e}^{-u^2}\mathrm{d} u\\
 =\,& - \frac{(\gamma + \ln 4)\sqrt \pi}{4\sqrt y} - \frac{\sqrt{\pi}\ln y}{4\sqrt y},
\end{align*}
and
$$\int_0^\infty \mathrm{e}^{-y} y^{n - 3/2}\ln y \, \mathrm{d}y = \Gamma'(n - 1/2) = \psi(n - 1/2)\Gamma(n - 1/2).$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \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{\on}[1]{\operatorname{#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}
&\bbox[5px,#ffd]{\int_{0}^{\infty}{\ln\pars{x} \over
\pars{x^{2} + 1}^{n}}\,\dd x} \stackrel{x^{2}\ \mapsto\ x}{=}
\int_{0}^{\infty}{\ln\pars{x}/2 \over
\pars{x + 1}^{n}}\pars{{1 \over 2}\, x^{-1/2}}\,\dd x
\\[5mm] = &
\left.{1 \over 4}\partiald{}{\nu}\int_{0}^{\infty}x^{\nu - 1}\,
\pars{1 + x}^{-n}\,\dd x\right\vert_{\nu\ =\ 1/2}
\end{align}
In a neighborhood of $\ds{x = 0}$, $\ds{\quad\pars{1 + x}^{-n} =
\sum_{k = 0}^{\infty}{\Gamma\pars{n + k} \over
\Gamma\pars{n}}{\pars{-x}^{k} \over k!}}$ such that via
$Ramanujan's\ Master\ Theorem$, I'll find
\begin{align}
&\bbox[5px,#ffd]{\int_{0}^{\infty}{\ln\pars{x} \over
\pars{x^{2} + 1}^{n}}\,\dd x} =
{1 \over 4}\partiald{}{\nu}\bracks{\Gamma\pars{\nu}{\Gamma\pars{n - \nu} \over \Gamma\pars{n}}}_{\nu\ =\ 1/2}
\\[5mm] = & \
\bbx{\color{#44f}{-\, {\root{\pi}\Gamma\pars{n - 1/2}\bracks{H_{n - 3/2}\,\,\, +\,\,\, 2\ln\pars{2}} \over 4\Gamma\pars{n}}}}\label{1}\tag{1}
\end{align}
From \eqref{1}, you can $\ds{\underline{\large in\!f\!er}}$ the coveted result.
A: Let $I\left(\lambda\right)=\int_0^{\infty} \frac{x^{2 \lambda-1}}{\left(a^2+x^2\right)^n} d x,$ then
$$I_n=\int_0^{\infty} \frac{\ln x}{\left(a^2 +x^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 $x=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 x}{\left(a^2+x^2\right)^n} d x= \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] },$$
Back to our integral,
$$\boxed{\int_0^{\infty} \frac{\ln x}{\left(1+x^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),$$
