# Definite integral of complex gaussial-like function

• spyke2050
the question is how to solve the next:∫...∫exp(-(a+b*x1+c*x1*x4+d*x3*x4+f*x2*x3*x4)^2)dx1dx2dx3dx4a,b,c,d,f - real constants;x1,x2,x3,x4 - real variables;borders of integration are finite, let say for x1 it is [x1a,x1b] and so on for the rest of them;i'v tried to solve it in terms of tensor vector multiplication. it solvable on paper butf

#### spyke2050

so the question is how to solve the next:

∫...∫exp(-(a+b*x1+c*x1*x4+d*x3*x4+f*x2*x3*x4)^2)dx1dx2dx3dx4

a,b,c,d,f - real constants;
x1,x2,x3,x4 - real variables;
borders of integration are finite, let say for x1 it is [x1a,x1b] and so on for the rest of them;

i'v tried to solve it in terms of tensor vector multiplication. it solvable on paper but it's practical realization is rather impossible.

so i would be appreciate for any pointers or directions for solution.

so the question is how to solve the next:

∫...∫exp(-(a+b*x1+c*x1*x4+d*x3*x4+f*x2*x3*x4)^2)dx1dx2dx3dx4

a,b,c,d,f - real constants;
x1,x2,x3,x4 - real variables;
borders of integration are finite, let say for x1 it is [x1a,x1b] and so on for the rest of them;

i'v tried to solve it in terms of tensor vector multiplication. it solvable on paper but it's practical realization is rather impossible.

so i would be appreciate for any pointers or directions for solution.

If you could solve this integral in the general case, a fortiori, you could solve it in the much simpler case a=0, b=1, c=0, d=0, f=0.
By the way, could you solve it in the case a=0, b=1, c=0, d=0, f=0 ?
Try it and see where is the hitch !

As long as the integration limits are finite the best you can hope for is something involving the error function.

I agree with jjacquelin. Your notation indicates you are trying to perform an iterated integral. With respect to each variable x, the integral has the form $\int e^{p + qx} dx$ where $p$ and $q$ are constants. Can you not do that integration?

I agree with jjacquelin. Your notation indicates you are trying to perform an iterated integral. With respect to each variable x, the integral has the form $\int e^{p + qx} dx$ where $p$ and $q$ are constants. Can you not do that integration?
The expression in the exponent is squared, so it looks more like a Gaussian, not an exponential.

ok, let me restate a problem a bit:

$\int$...$\int$exp($\sum_{i,j,k}$A$_{i,j,k}$x$_{i}$x$_{j}$x$_{k}$)dx$_{i}$dx$_{j}$dx$_{k}$

what whould be the solution to above definite integral?
solution is not required to be exact.
i would be appreciated for any hints for solution.

i went through a few already but thay are not satisfactory in terms of numerical computation.

thanks again

I fail to see why you would have any problems evaluating the integral numerically to any reasonable level of accuracy. Here's an example in Mathematica:

Code:
a = 2;
b = -3;
c = -4;
d = 2.5;
e = 7.6;
f = -3.2;
x1a = 2;
x1b = 7;
x2a = 3;
x2b = 17;
x3a = -4;
x3b = 12;
x4a = -22;
x4b = 22;
NIntegrate[
Exp[-(a + b x1 + c x1 x4 + d x3 x4 + f x2 x3 x4)^2], {x1, x1a,
x1b}, {x2, x2a, x2b}, {x3, x3a, x3b}, {x4, x4a, x4b},
PrecisionGoal -> 6, AccuracyGoal -> 6]

I fail to see why you would have any problems evaluating the integral numerically to any reasonable level of accuracy. Here's an example in Mathematica:

Code:
a = 2;
b = -3;
c = -4;
d = 2.5;
e = 7.6;
f = -3.2;
x1a = 2;
x1b = 7;
x2a = 3;
x2b = 17;
x3a = -4;
x3b = 12;
x4a = -22;
x4b = 22;
NIntegrate[
Exp[-(a + b x1 + c x1 x4 + d x3 x4 + f x2 x3 x4)^2], {x1, x1a,
x1b}, {x2, x2a, x2b}, {x3, x3a, x3b}, {x4, x4a, x4b},
PrecisionGoal -> 6, AccuracyGoal -> 6]

I need analitical solution for that integral. Not just numerical evaluation of that integral. I got some solutions. But the thing is that those solutions are absolutely impractical for numerical computation.

Then in an act of utter desperation I would investigate the possibility of expanding the exponential function using the multinomial theorem:

$$\overset{\text{n-folded}}{\int\cdots\int}\exp(P(x_n)^2)d^nx=\sum_{k=0}^{\infty}\overset{\text{n-folded}}{\int\cdots\int}\frac{P(x_n)^{2k}}{k!}d^nx$$

Actually I initiallly tried this when you first posted the thread but got dizzy with the indicies. Maybe though you could do better.

Then in an act of utter desperation I would investigate the possibility of expanding the exponential function using the multinomial theorem:

$$\overset{\text{n-folded}}{\int\cdots\int}\exp(P(x_n)^2)d^nx=\sum_{k=0}^{\infty}\overset{\text{n-folded}}{\int\cdots\int}\frac{P(x_n)^{2k}}{k!}d^nx$$

Actually I initiallly tried this when you first posted the thread but got dizzy with the indicies. Maybe though you could do better.

that solution was my first choice. but it's too messy and computationally costly.

but thakns anyway

that solution was my first choice. but it's too messy and computationally costly.

You sure about that? Won't reduce down huh? I mean comet coming and all, just gotta' have it to save the world even if it's messy. Just no way right? Even on one of those fast parallel-processing computers?

I fail to see why you would have any problems evaluating the integral numerically to any reasonable level of accuracy.

I fully agree with jackmell opinion.
What can we expect from analytical resolution for a so awful integral ? Recourse to arduous special functions ? Huge formula, even in terms of infinite series ?
Even if it was possible, this would be "messy and computationally costly" as spyke2050 complains.
The direct numerical integration, as proposed by jackmell, is far to be the less messy and the less costly way.

If I may add to that, we can also compute a very good "analytic" approximation to the numeric solution for example using Mathematica's "Interpolation" or "Fit" or other functions. This will produce a function f as a function of one or more variables you wish to select, which can then be differentiated, integrated, and used for all practical purposes, as a very good subsittiute for the actual analytic solution.

Last edited:
You sure about that? Won't reduce down huh? I mean comet coming and all, just gotta' have it to save the world even if it's messy. Just no way right? Even on one of those fast parallel-processing computers?

well the thing is that it should be computed from thousands to millions times. so matematica isn't the solution i hoped for.

ok guys thank you for help

best regards

well the thing is that it should be computed from thousands to millions times. so matematica isn't the solution i hoped for.
If it should be computed millions times, clearly the most economic method is the direct numerical integration, because it avoids a lot of intermediate steps and/or series and/or special functions, which respective numerical computation are often more time consuming that the direct numerical integration of the initial function.

If it should be computed millions times, clearly the most economic method is the direct numerical integration, because it avoids a lot of intermediate steps and/or series and/or special functions, which respective numerical computation are often more time consuming that the direct numerical integration of the initial function.

really? it's kind of surprising. but ok, i'll try to do so then.
thanks

it should be computed from thousands to millions times. so matematica isn't the solution i hoped for.

That isn a clear description of the scenario. Are you talking about a thousand actuaries doing this calculation on their PC 10 times a day? Or are you talking about one computer program doing this calculation thosands of times and hopefully completing its task in 5 minutes? Assuming someone will pay for a thousand Mathematic licenses, Mathematicia is a sufficient tool for the former problem.

That isn a clear description of the scenario. Are you talking about a thousand actuaries doing this calculation on their PC 10 times a day? Or are you talking about one computer program doing this calculation thosands of times and hopefully completing its task in 5 minutes? Assuming someone will pay for a thousand Mathematic licenses, Mathematicia is a sufficient tool for the former problem.

it's one computer program should all those computations.