Re: Help with Multiple Integrals

• To: mathgroup at smc.vnet.net
• Subject: [mg19543] Re: [mg19468] Help with Multiple Integrals
• From: "Wolf, Hartmut" <hwolf at debis.com>
• Date: Tue, 31 Aug 1999 00:52:29 -0400
• Organization: debis Systemhaus
• References: <199908281953.PAA24442@smc.vnet.net.>
• Sender: owner-wri-mathgroup at wolfram.com

```Andrew Wang schrieb:
>
> I'm new to Mathematica and I need to solve a summation in which each
> term has a different  number of multiple integrals. To be more specific,
> my n-th term should look like:
>
>  g[n] NIntegrate[ f[n], {x1, a,b},{x2, x1, b}, ... , {xn, xn-1,b}];
>
> a,b are constants and f[n] is an expression that involves x1, x2, ...,
> xn (so each term has a different number of integration variables), with
> n going from 1 to N. I could define all the N terms of my summation but
> since N is really large, it's unfeasible to do it manually. Is there any
> way of defining a function in Mathematica to build and evaluate each
> term given n? I could also write a script not in Mathematica to build
> all the terms and save them on a file to be read from Mathematica, but
> is it possible to do it in Mathematica (to use string manipulation to
> "build" the n-th term and then evaluate it)?
>
If you define recursively

In[1]:= ivr[1] = {x1, a, b};
In[2]:= ivr[n_] :=
Sequence[ivr[n - 1], {ToExpression["x" <> ToString[n]],
ToExpression["x" <> ToString[n - 1]], b}]

you get

In[3]:= g[#] NIntegrate[f[#], Evaluate[ivr[#]]] & @4
NIntegrate::"nlim": "\!\(x1\) = \!\(a\) is not a valid limit of
integration."
Out[3]=
g[4] NIntegrate[f[4], {x1, a, b}, {x2, x1, b}, {x3, x2, b}, {x4, x3, b}]

So when you Map it over Range[N] you'll get a List of all your
integrals. (Of course you shall not get the error since you defined
everthing.)

Kind regards, hw

```

• Prev by Date: Re: \$MachineEpsilon
• Next by Date: Re: Simple edit ...
• Previous by thread: Help with Multiple Integrals
• Next by thread: Re: Help with Multiple Integrals