# Definite integral of complex gaussial-like function

1. Nov 3, 2011

### 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.

2. Nov 3, 2011

### JJacquelin

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 !

3. Nov 3, 2011

### mathman

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

4. Nov 7, 2011

### Stephen Tashi

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?

5. Nov 8, 2011

### mathman

The expression in the exponent is squared, so it looks more like a Gaussian, not an exponential.

6. Nov 9, 2011

### spyke2050

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

7. Nov 9, 2011

### jackmell

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 (Text):

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]

8. Nov 10, 2011

### spyke2050

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.

9. Nov 10, 2011

### jackmell

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.

10. Nov 10, 2011

### spyke2050

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

but thakns anyway

11. Nov 10, 2011

### jackmell

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?

12. Nov 10, 2011

### JJacquelin

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.

13. Nov 10, 2011

### jackmell

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: Nov 10, 2011
14. Nov 11, 2011

### spyke2050

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

15. Nov 11, 2011

### JJacquelin

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.

16. Nov 14, 2011

### spyke2050

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

17. Nov 14, 2011

### Stephen Tashi

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.

18. Nov 15, 2011

### spyke2050

it's one computer program should all those computations.