# Integrate over Regions

Integrate over any region. The actual integral used depends on the dimension of the region: a curve integral for one-dimensional integrals, a surface integral for two-dimensional regions, etc. Integrals can be computed symbolically or numerically.

The curve length is an integral over a curve.

 In[1]:= XIntegrate[1, {x, y} \[Element] Circle[{1, 2}, r]]
 Out[1]=
 In[2]:= XIntegrate[1, {x, y, z} \[Element] Line[{{0, 0, 0}, {1, 1, 1}}]]
 Out[2]=

The surface area is an integral over a surface.

 In[3]:= XIntegrate[1, {x, y} \[Element] Disk[]]
 Out[3]=
 In[4]:= XIntegrate[1, {x, y, z} \[Element] Sphere[]]
 Out[4]=

The solid volume is an integral over a solid.

 In[5]:= XIntegrate[1, {x, y, z} \[Element] Ball[]]
 Out[5]=
 In[6]:= XIntegrate[1, {x, y, z} \[Element] Tetrahedron[]]
 Out[6]=

Integrate in any number of dimensions.

 In[7]:= XIntegrate[\!\( \*SubsuperscriptBox[\(x\), \(1\), \(2\)]\ \*SubsuperscriptBox[\(x\), \(2\), \(2\)]\ \*SubsuperscriptBox[\(x\), \(3\), \(2\)]\ \*SubsuperscriptBox[\(x\), \(4\), \(2\)]\ \*SubsuperscriptBox[\(x\), \(5\), \(2\)]\), {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5]} \[Element] Ball[{0, 0, 0, 0, 0}, r]]
 Out[7]=

Use symbolic vector variables.

 In[8]:= XIntegrate[Norm[x], x \[Element] Ball[{0, 0, 0, 0, 0}]]
 Out[8]=
 In[9]:= XIntegrate[ Norm[{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5]}], {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5]} \[Element] Ball[{0, 0, 0, 0, 0}]]
 Out[9]=

Integrate over any region.