# Closed-form solution for a triple integral

• I
Hello all,

I need to evaluate the following 3-dimensional integral in closed-form (if possible)

$$\int_{y_1=0}^{\infty}\int_{y_2=0}^{\infty}\int_{x_2=0}^{zy_2}\exp\left(-\min(x_2,\,y_1(z-\frac{x_2}{y_2}))\right)e^{-(K-1)x_2}e^{-y_1}e^{-y_2}\,dx_2dy_2dy_1$$

where ##z## is real positive number, and ##K \geq 1## is an integer.

I need to find a way to divide the limits of the integrals such that the resulting integrals can be evaluated in closed-form, or at least in compact form in terms of functions that are implemented in major scientific software like MATLAB.

What I did was that I divided the inner most integral into two interval as following

$$\int_{y_1=0}^{\infty}\int_{y_2=0}^{\infty}\int_{x_2=0}^{\frac{z\,y_1y_2}{y_1+y_2}}e^{-Kx_2}e^{-y_1}e^{-y_2}\,dx_2dy_2dy_1 + \int_{y_1=0}^{\infty}\int_{y_2=0}^{\infty}\int_{x_2=\frac{z\,y_1y_2}{y_1+y_2}}^{zy_2}\exp\left(-y_1(z-\frac{x_2}{y_2})\right)e^{-(K-1)x_2}e^{-y_1}e^{-y_2}\,dx_2dy_2dy_1$$

but this gives a very complicated integrals to be evaluated at some point later. Is there any other way I can divide the integrals (over ##y_1## and/or ##y_2## and/or ##x_2##) in a way that would make the integrals easier to evaluate?

## Answers and Replies

Delta2
Homework Helper
Gold Member
Hmm, I guess you stumble upon integrals of the form ##\int e^{-f(y)}dy## where ##f(y)## is not a linear function of y, and hence those integrals probably don't have closed form.

Either numerical integration or to try to approximate the ##f(y)## functions with some proper linear approximation functions ##g(y)##. In both cases you ll find approximations for the integral.

Hmm, I guess you stumble upon integrals of the form ##\int e^{-f(y)}dy## where ##f(y)## is not a linear function of y, and hence those integrals probably don't have closed form.

Either numerical integration or to try to approximate the ##f(y)## functions with some proper linear approximation functions ##g(y)##. In both cases you ll find approximations for the integral.

An approximation would be fine. I am trying to avoid the numerical integration because it is computationally expensive. How can I approximate ##
\min(x_2,\,y_1(z-\frac{x_2}{y_2}))## as a linear function of ##x_2##, and how close the approximation would be?

Delta2
Homework Helper
Gold Member
My original thought was to do the "break" as you did in the OP, then do the integrations with respect to ##x_2##, (if i am not wrong the exponentials will be linear with respect to ##x_2## )and then starting doing the linear approximations with respect to ##y_1## and ##y_2##.

But ok if you want a linear approximation of the minimum function take it to be the arithmetic mean of the two values, ##\frac{x_2+y_1(z-x_2/y_2)}{2}## it will be linear with respect to ##x_2##, however after you integrate with respect to ##x_2##, or at the very end you ll get exponents that are not linear with respect to ##y_1## (or ##y_2##) so you ll have to do another linear approximation there.

Last edited:
The problem is not integrating with respect to ##x_2## but rather with respect to ##y_1## and ##y_2##. I get integrals that have no closed/compact form solution. for example, some integrals over ##y_1## and ##y_2## looks like this

$$\int_0^{\infty}\int_0^{\infty}\exp\left(-y_2\left[\frac{Kzy_1}{y_1+y_2}\right]\right)e^{-y_1}\,dy_2dy_1$$

Delta2
Homework Helper
Gold Member
Well ok, if you do the linear approximation of the minimum function as I suggested, probably you wont get such integrals with respect to ##y_1,y_2##.

Still you can do linear approximations even in such integral for example you could approximate ##y_1+y_2## as ##y_1## and then all you ll left with will be ##e^{-Kzy_2}e^{-y_1}## .

Last edited:
What is the justification for approximating y1+y2 as y1?

Delta2
Homework Helper
Gold Member
What is the justification for approximating y1+y2 as y1?
Not much justification, we are just "despaired" to do linear approximations …

Maybe one justification would be as y1 goes to infinity, y1 is the term that survives in y1+y2, so if you gonna first integrate that with respect to y1, then you can do this approximation..

Not much justification, we are just "despaired" to do linear approximations …

Maybe one justification would be as y1 goes to infinity, y1 is the term that survives in y1+y2, so if you gonna first integrate that with respect to y1, then you can do this approximation..

It is true that when ##y_1## goes to infinity, ##y_1+y_2## can be approximated as ##y_1##, but only if ##y_2## doesn't go to infinity at the same time.

Delta2
Homework Helper
Gold Member
Apparently you don't like my blunt linear approximations... :P

Best I can think now is to have a look at this http://www.wolframalpha.com/input/?i=integral+e^(-axy/(y+x))dy

I used x and y instead of y1 and y2. That integral result is "almost closed form", the only thing is that the function ##Ei(z)## (exponential integral) doesn't have a closed form but a good approximation for it is ##Ei(z)=\gamma+lnz+z##. where ##\gamma## the Euler-Mascheroni constant. You can as well take ##Ei(z)=\gamma## but I know you ll tell me such approximation is not justified :D

Last edited:
Exponential integral function is fine, because it is implemented in MATLAB. The remaining question is: how Mathematica obtained this result? I need some references and steps on how the results are obtained.

The inner most integral will evaluate to (which the definite integral to the indefinite integral evaluated using Mathematica)

$$Ky_1^2Ei(-Ky_1)-1-y_1$$

In the table of integrals there is a solution to the integral

$$\int_0^{\infty}x^{v-1}Ei(-\beta\,x)e^{-\mu\,x}\,dx$$

for the next level integral. Do you have any idea how to evaluate the integral, and obtain the same results as Mathematica?

Delta2
Homework Helper
Gold Member
Exponential integral function is fine, because it is implemented in MATLAB. The remaining question is: how Mathematica obtained this result? I need some references and steps on how the results are obtained.

I think wolfram does integration by parts on the function ##f(y)=(x+y)e^{-a\frac{xy}{x+y}}##

Beware the input I gave to wolfram was to essentially calculate ##\int e^{-y_2\frac{Kzy_1}{y_1+y_2}}dy_2##
In the table of integrals there is a solution to the integral

$$\int_0^{\infty}x^{v-1}Ei(-\beta\,x)e^{-\mu\,x}\,dx$$

for the next level integral. Do you have any idea how to evaluate the integral, and obtain the same results as Mathematica?
Don't see any other way than to use some of the approximations I suggested for the ##Ei(z)## function. Even if we use the simplest approximation ##Ei(z)=\gamma## this integral needs repeated integration by parts...

The more detailed approximation for ##Ei(z)## for positive real z, is

##Ei(z)=\gamma+lnz+\sum_{n=1}^{\infty}\frac{z^n}{nn!}##

EDIT : Surprising but wolfram seems to find a "closed" form for this integral for ##v=3##
http://www.wolframalpha.com/input/?i=integral+x^2ei(-bx)e^(-\mu+x)dx

Apparently a useful property of the Ei(z) function (which you can use to do integration by parts for this integral) is that
##\frac{dEi(z)}{dz}=\frac{e^z}{z}##, that is it has a closed form derivative.

Last edited:
The integration

$$\int_0^{\infty}x^{v-1}Ei(-\beta\,x)e^{-\mu\,x}\,dx = e^{\beta\mu}\left[Ei(-\mu u-\beta\mu) - Ei(-\beta\mu)\right]$$

has a compact-form solution in the table of integrals. The condition that needs to be met is that ##\Re\{\mu+\beta\} > 0##. I think there is no problem here. I just need to evaluate the first integral, namely

$$\int_0^{\infty}\exp\left(-y_2\left[\frac{Kzy_1}{y_1+y_2}\right]\right)\,dy_2$$

Delta2
Homework Helper
Gold Member
Well, I tried to evaluate that integral and for some reason I get ##+\infty##

Here is what I did
Taking the expression from wolfram for the indefinite integral
##F(y_2)=\int \exp\left(-y_2\left[\frac{Kzy_1}{y_1+y_2}\right]\right)\,dy_2##

we have (where ##a=Kz>0##)

##F(y_2)=(y_1+y_2)e^{-\frac{ay_1y_2}{y_1+y_2}} -ay_1^2e^{-ay_1}Ei(a\frac{y_1^2}{y_1+y_2})##

We need to find ##\lim_{y_2\to \infty}F(y_2)-\lim_{y_2\to 0}F(y_2)##

I find ##\lim_{y_2\to \infty}F(y_2)=(+\infty)e^{-a}-ay_1^2e^{-ay_1}Ei(0))=(+\infty)-(-\infty)=(+\infty)##
while ##\lim_{y_2\to 0}F(y_2)=y_1-ay_1^2e^{-ay_1}Ei(ay_1)##

It might be the case that the integral with respect to y2 does not converge but the double integral of y1 and y2 converges.

Last edited:
EngWiPy
So, there is no closed-form solution for it, and I have to resort to numerical integration?

Delta2
Homework Helper
Gold Member
So, there is no closed-form solution for it, and I have to resort to numerical integration?

Well seems so to me, see if there is too much difference in the result you get by numerical integration, and in the result you get if you "linearly" approximate it as ##\int_0^\infty\int_0^\infty e^{(-Kzy_2)}e^{-y_1}dy_2dy_1##. The last integral value is ##\frac{1}{Kz}## if I am not wrong.