Re: Help with Multiple Integrals
- To: mathgroup at smc.vnet.net
- Subject: [mg19521] Re: [mg19468] Help with Multiple Integrals
- From: BobHanlon at aol.com
- Date: Sun, 29 Aug 1999 03:00:40 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Clear[a, b, f, g, n]; k = 3; var = Table[ToExpression["x" <> ToString[i]], {i, k}]; lim = ReplacePart[RotateRight[var], a, 1]; iter = Transpose[{var, lim, Table[b, {k}]}]; This is the form required g[n]*Integrate[f[var, n], Evaluate[Sequence @@ iter]] g[n]*Integrate[f[{x1, x2, x3}, n], {x1, a, b}, {x2, x1, b}, {x3, x2, b}] For a specific function g[n]*Integrate[x1^n * x2^(n - 1)*x3, Evaluate[Sequence @@ iter]]; % /. {n -> 3, a -> 1., b -> 5.} 7698.996825396825*g[3] Using NIntegrate n = 3; a = 1; b = 5; g[n]*NIntegrate[x1^n * x2^(n - 1)*x3, Evaluate[Sequence @@ iter]] 7698.996836118737*g[3] Bob Hanlon In a message dated 8/28/99 7:51:21 PM, ke at bu.edu writes: >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)? >