= Integral of an affine function over a simplex
{title2=$\int_Sf(x)\,dx=\frac{\operatorname{vol}(S)}{d+1}\sum_{i=0}^df(v_i)$}
For a nondegenerate $d$-dimensional <simplex> $S$ with vertices $v_0,\ldots,v_d$ and an <affine function> $f$, the integral equals the volume times the value at the <centroid> $c=(v_0+\cdots+v_d)/(d+1)$. To prove this, write $x=\sum_i\lambda_i(x)v_i$ in a <barycentric coordinate system>. On the standard simplex, symmetry permuting the vertices gives equal integrals of all $\lambda_i$; since $\sum_i\lambda_i=1$, each is $\operatorname{vol}(S)/(d+1)$. An invertible <affine map> transfers this result to any simplex. Affineness gives $f(x)=\sum_i\lambda_i(x)f(v_i)$, so <linearity of integration> proves the formula. For a tetrahedron the factor is one quarter. The rule is exact for affine integrands; a nonlinear integrand generally needs additional moments.
Back to article page