Re: variable dimension of domain of integration

*To*: mathgroup at smc.vnet.net*Subject*: [mg115990] Re: variable dimension of domain of integration*From*: Peter Pein <petsie at dordos.net>*Date*: Fri, 28 Jan 2011 06:15:29 -0500 (EST)*References*: <ihrb36$8qe$1@smc.vnet.net>

On 27.01.2011 09:41, 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 > ndim[n_] := NIntegrate @@ Prepend[#, Sqrt@Tr[#[[All, 1]]^2]]&[Table[{x[i], 0, 1}, {i, n}]]