# How to find the integral $\int_{0}^{\infty}\exp(- (ax+b/x))\,dx$?

How do I find $$\large\int_{0}^{\infty}e^{-\left(ax+\frac{b}{x}\right)}dx$$ where $a$ and $b$ are positive numbers?

This is not a homework question. I will be quite happy if somebody can come up with a sort of bound, like an upper bound or a lower bound of integrand.

-
What have you tried? –  Mhenni Benghorbal Feb 5 '14 at 6:54
tried integration by parts, but didn't seem to work out. –  dineshdileep Feb 5 '14 at 7:04
It is not an elementary integral. –  Mhenni Benghorbal Feb 5 '14 at 7:08
WolframAlpha sort of demurred on the indefinite integral and just said the anti-derivative "couldn't be expressed in terms of elementary functions". [I often like to see what it does on the integrations that are known to be nasty...] –  RecklessReckoner Feb 5 '14 at 7:24
Lazy but wondering - what if one squares the integrand to get $e^{-x^2} * e^{-1/x^2}*e^{-2}$ and then tries to play games in the complex plane similar to the way one solves the integral of $e^{-x^2}$ ? –  Carl Witthoft Feb 5 '14 at 13:02

Sub $u=a x+b/x$. Then $a x^2-u x+b = 0$, and therefore

$$x = \frac{u}{2 a} \pm \frac{\sqrt{u^2-4 a b}}{2 a}$$

$$dx = \frac1{2 a}\left (1 \pm \frac{u}{\sqrt{u^2-4 a b}}\right ) du$$

Now, it should be understood that as $x$ traverses from $0$ to $\infty$, $u$ traverses from $\infty$ down to a min of $2 \sqrt{a b}$ (corresponding to $x \in [0,\sqrt{b/a}]$), then from $2 \sqrt{a b}$ back to $\infty$ (corresponding to $x \in [\sqrt{b/a},\infty)$). Therefore the integral is

$$\frac1{2 a} \int_{\infty}^{2 \sqrt{a b}} du \left (1 - \frac{u}{\sqrt{u^2-4 a b}}\right ) e^{-u} + \frac1{2 a} \int_{2 \sqrt{a b}}^{\infty} du \left (1 + \frac{u}{\sqrt{u^2-4 a b}}\right ) e^{-u}$$

which simplifies to

$$\frac1{a} \int_{2 \sqrt{a b}}^{\infty} du \frac{u}{\sqrt{u^2-4 a b}} e^{-u} = 2 \sqrt{\frac{b}{a}} \int_0^{\infty} dv \cosh{v} \, e^{-2 \sqrt{a b} \cosh{v}}$$

which is then

$$\int_0^{\infty} dx \, e^{-(a x+b/x)} = 2 \sqrt{\frac{b}{a}} K_1\left ( 2 \sqrt{a b}\right )$$

-
So beautiful. One more think I learnt ! Thanks for that. –  Claude Leibovici Feb 5 '14 at 9:59
Brilliant! very good answer –  franvergara66 Feb 5 '14 at 12:15
I've never seen that method before, turning $x=...$ into $dx=...$ what's that called and what's the argument that it's valid? –  spraff Feb 5 '14 at 13:31
@spraff $dx = … du$ is what I've always been taught to write as ${dx \over du} = …$, it is simply taking the derivative. –  hvd Feb 5 '14 at 13:40
@enthdegree: Modified Bessel function of the second kind, of order $1$. –  Ron Gordon Feb 6 '14 at 7:08

As you say, this is a difficult integral. Provided $\Re(a)>0$ and $\Re(b)>0$, the solution I found is $$\frac{2 \sqrt{b} K_1\left(2 \sqrt{a} \sqrt{b}\right)}{\sqrt{a}}$$ in which appears the modified Bessel function of the second kind.

I obtained the result from a CAS. I have not been able to obtain any analytical form for the antiderivative but, surprizingly, the integral came out !

-
ya, you can assume they are positive, but may i know how you derived this. –  dineshdileep Feb 5 '14 at 7:17
I obtained the result from a CAS. I have not been able to obtain any analytical form for the antiderivative but, surprizingly, the integral came out. –  Claude Leibovici Feb 5 '14 at 7:41
can you please elaborate? I would like to inform you that this comes from a real world engineering problem I am working on and am not a mathematician. –  dineshdileep Feb 5 '14 at 7:44
I really cannot tell you more except my surprize when I got the result for the integral. When I started, I thought that I should not get any result. By the way, I am a physicist and from very far away not a real mathematician. –  Claude Leibovici Feb 5 '14 at 8:00

Of course we need $a,b>0$.

Knowing that the answer is supposed to be what Claude obtained, I can confirm that. By linear change of variables, we may assume $a=1$. Also for convenience take $b = c^2/4$. So now let $$F(c) = \dfrac{1}{c} \int_0^\infty e^{-x - c^2/(4 x)}\ dx$$ I claim $F(c) = K_1(c)$.
A differential equation for $y(c) = K_1(c)$ is $$y'' + \dfrac{1}{c} y' - \left(1 - \dfrac{1}{c^2}\right) y = 0$$ If we apply that to $F(c)$ and do some simplification, we get $$F'' + \dfrac{1}{c} F' - \left(1 - \dfrac{1}{c^2}\right) F = \int_0^\infty e^{-x-c^2/(4x)} \dfrac{c^2 - 4 x^2}{4 c x^2}\ dx$$ Using the change of variables $x = c^2/(4t)$, the right side becomes $$- \int_0^\infty e^{-t-c^2/(4t)} \dfrac{c^2 - 4 t^2}{4 c t^2}\ dt$$ and therefore is $0$. Now the general solution of the differential equation is $A I_1(c) + B K_1(c)$ where $A$ and $B$ are arbitrary constants. $K_1(c)$ is the solution that goes to $0$ as $c \to +\infty$ and is asymptotic to $1/c$ as $c \to 0+$.

-
Nice answer ! Thanks for it. –  Claude Leibovici Feb 5 '14 at 10:04


Let's $\ds{x \equiv A\expo{\theta}}$ such that $\ds{ax + {b \over x} = aA\expo{\theta} + {b \over A}\,\expo{-\theta}}$. We can choose $\ds{A}$ to satisfy $\ds{aA = {b \over A}\quad\imp\quad A =\root{b \over a}}$. Then, $\ds{ax + bx = a\root{b \over a}\pars{\expo{\theta} + \expo{-\theta}} =2\root{ab}\cosh\pars{\theta}}$

\begin{align} &\color{#c00000}{\int_{0}^{\infty}\expo{-\pars{ax + b/x}}\,\dd x} =\int_{-\infty}^{\infty}\expo{-2\root{ab}\cosh\pars{\theta}}\root{b \over a} \expo{\theta}\,\dd\theta \\[3mm]&=\root{b \over a}\int_{-\infty}^{\infty}\expo{-2\root{ab}\cosh\pars{\theta}} \bracks{\cosh\pars{\theta} + \sinh\pars{\theta}}\,\dd\theta \\[3mm]&=\color{#c00000}{2\root{b \over a}\ \overbrace{\quad\int_{0}^{\infty}\expo{-2\root{ab}\cosh\pars{\theta}} \cosh\pars{\theta}\,\dd\theta\quad}^{\ds{{\rm K}_{1}\pars{2\root{ab}}}}} \end{align} where $\ds{{\rm K}_{\nu}\pars{z}}$ is a Modified Bessel Function. See ${\bf 9.6.24}$ formula.

$$\color{#00f}{\large% \int_{0}^{\infty}\expo{-\pars{ax + b/x}}\,\dd x =2\root{b \over a}{\rm K}_{1}\pars{2\root{ab}}}$$

-
+1 Nice SOlution. –  Integrals May 3 '14 at 7:06

Hint: $$\int e^{f(x)}dx=\frac{e^{f(x)}}{f'(x)}$$

-
Good luck with the $\ e^{-b/x} \$ factor... –  RecklessReckoner Feb 5 '14 at 7:01
?!?!?!?!?!?!?!? $\int e^xdx = e^x/e^x=\cdots= 1!$? –  Martín-Blas Pérez Pinilla Feb 5 '14 at 8:14
@Martín-BlasPérezPinilla: No, that would be $e^x/1$, so the formula actually gives the right result for $\int e^x \, dx$. But of course it's completely wrong in general (when $f'(x)$ is not constant). –  Hans Lundmark Feb 5 '14 at 9:37