I am trying to evaluate the following integral, with $m\in \mathbb{N}$, $a, b \in \mathbb{R}$, $a>0, b>0$.

$$ \int_{0}^{\infty}\frac{(\log{x})^m}{x}\exp(-ax - b/x)\,dx. $$

I can find answers for related integrals, for example from "Table of integrals, series, and product" p.575: $$ \int_0^{\infty}\exp{\left[\mu\left(\frac{x}{a} + \frac{a}{x}\right)\right]}\ln{x}\,\frac{dx}{x} = 2\ln{a}K_0(2\mu). $$ But I haven't been able to find anything with exponent $m\geq2$.

For $m=1$, the answer from wolfram alpha is $$ \int_{0}^{\infty}\frac{\log{x}}{x}\exp(-ax - b/x)\,dx = \log{\left(\frac{b}{a}\right)}K_0(2\sqrt{ab}). $$ Where $K_0(x)$ is the modified Bessel function of the second kind. I am pretty sure that the connection to $K_0(x)$ comes from the following integral representation: $$ K_{\alpha}(x) = \int_{0}^{\infty}\exp{(-x\cosh{t})}\cosh{\alpha t}\,dt. $$

The integrand vanishes at $0$ and $\infty$, so it is possible to use integration by parts to rewrite the integral in terms of similar integrals of the form:

$$ f(k, m) = \int_{0}^{\infty}\frac{(\log{x})^{m'}}{x^{k'}}\exp(-ax - b/x)\,dx $$ with different values $m',\,k'$. as long as $m'=1$ Wolfram alpha can provide analytical solutions, even though they get messy. One possible route would be to recursively rewrite the integral in terms of similar integrals with lower $m'$-values, and eventually get down to the base case with $m'=1$. But I don't know if that is feasable.

(Note: To the question of what kind of answer I am looking for. I want a closed form solution of some kind. Expressing the integral in terms of the modified bessel function of the second kind seems like a good candidate. For different values of $m$ the solution will look different of course. It might not be possible to get a neat expression that works for all $m$? But at least get some sort of procedure to calculate.)

EDIT I think I have it now. The integral can be written as a Mellin transform. And multiplication by a factor $(\log{x})^{m^{'}}$ is the same as differentiating the transform $m$ times. After some quick and dirty, I got

$$ \mathcal{M}\{\exp(-ax -b/x)\} = 2\left(\frac{b}{a}\right)^{s/2}K_{-s}(2\sqrt{ab}) $$

So just differentiate that expression w.r.t. $s$, $m$ times, and then evaluate at $s=0$.

  • 2
    $\begingroup$ $\log x^m=m\log x$ reduces the cases to $m=1$. $\endgroup$ Commented Jan 10, 2022 at 22:21
  • $\begingroup$ by $\log{x}^m$ I mean $(\log{(x)})^m$. Thanks for your comment, I will edit to clarify $\endgroup$
    – martin
    Commented Jan 10, 2022 at 23:01
  • 1
    $\begingroup$ I was working on my answer and so did not see your edit. I provide slightly more information though. $\endgroup$
    – Gary
    Commented Jan 10, 2022 at 23:37

1 Answer 1


We have \begin{align*} &\int_0^{ + \infty } {\frac{{(\log x)^m }}{x}\exp ( - ax - b/x)dx} = \int_0^{ + \infty } {\left[ {\frac{{d^m }}{{d\nu ^m }}x^{\nu - 1} } \right]_{\nu = 0} \exp ( - ax - b/x)dx} \\ & = \left[ {\frac{{d^m }}{{d\nu ^m }}\int_0^{ + \infty } {x^{\nu - 1} \exp ( - ax - b/x)dx} } \right]_{\nu = 0} = 2\left[ {\frac{{d^m }}{{d\nu ^m }}\left( {\left( {\frac{b}{a}} \right)^{\nu /2} K_\nu (2\sqrt {ab} )} \right)} \right]_{\nu = 0} . \end{align*} The case $m=0$ is indeed expressible in terms of $K_0$ using the fact that $$ \left[ {\frac{d}{{d\nu }}K_\nu (z)} \right]_{\nu = 0} = 0 $$ (see below). The higher derivatives are more complicated objects. The first few of them are given here. An integral representation at $\nu=0$ is $$ \left[\frac{{d^m }}{{d\nu ^m }}K_\nu(z)\right]_{\nu = 0} = \frac{1}{2}\int_{ - \infty }^{ + \infty } {x^m \exp ( - z\cosh x)dx} . $$ You can see that these will vanish for odd $m$.

  • $\begingroup$ Thanks! greatly appreciated. Thanks for the reference aswell. $\endgroup$
    – martin
    Commented Jan 11, 2022 at 9:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .