MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: variable dimension of domain of integration

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115999] Re: variable dimension of domain of integration
  • From: Achilleas Lazarides <achilleas.lazarides at gmx.com>
  • Date: Fri, 28 Jan 2011 06:17:14 -0500 (EST)

This works:

Clear@f;
f[n_] := NIntegrate[
  Evaluate[Sqrt@Sum[x[i]^2, {i, 1, n}]],
  Evaluate[Sequence~Apply~Table[{x[i], 0, 1}, {i, 1, n}]]
  ];

but perhaps it's one of the inelegant ways...

On Jan27, 2011, at 9:41 AM, Ulvi Yurtsever wrote:

> Consider the function $f(n) = \int_{{0,1}^n}
> \sqrt{\sum_{i=1}^{n} {x_i}^2} dx_1 ... dx_n$.
> How would you define a mathematica function
> F[n_] (using NIntegrate) that computes this
> integral over the n-cube? I can think of several
> inelegant solutions; but surely there are neat
> ways of doing things of this sort...
> 
> 
> thanks
> 



  • Prev by Date: Mathematica 8 Integration Bug
  • Next by Date: MatrixPlot
  • Previous by thread: Re: variable dimension of domain of integration
  • Next by thread: Re: variable dimension of domain of integration