# Integral Calculus, Riemann Sums and Nets

## Riemann Sums and Nets

A net, or partition, of granularity δ over an interval [a,b]
is a finite array of points
x_{1} x_{2} … x_{n},
such that a ≤ x_{1} ≤ x_{2} ≤ … ≤ b,
and adjacent points are always within δof each other.
We assume x_{0} = a, and x_{n+1} = b.
Such a net is able to catch any fish of size δ or larger that try to swim through the interval [a,b].
The Riemann sum of a real valued function f() over an interval [a,b] is defined as
the sum of f(x_{i})×(x_{i+1}-x_{i}),
as i runs from 0 to n,
stepping through the points in the net.

Let's compute the area under the parabola y = x^{2}, from x = 0 to 1.
The trivial net, with no internal points, has only the endpoints 0 and 1.
The Riemann sum is f(0)×(1-0) = 0,
a rather poor estimate.
Add a point to the net, at x = 1/2, and the sum becomes
0×1/2 + 1/4×1/2 = 1/8.
If the net divides the interval into quarters, the sum is 14/64.
If the net divides the interval into sixths,
the sum is 55/216.
Continue this process and the area approaches 1/3.
Note that these nets have regularly spaced subintervals,
thus reproducing Aristotles rectangles.
In general, Riemann nets need not be regularly spaced.

Riemann sums generalize to higher dimensions.
Given a rectangular box in 3 space,
establish a Riemann net for each of the 3 dimensions.
Call these nets x, y, and z,
and compute the sum of:

f(x_{i},y_{j},z_{k}) × (x_{i+1}-x_{i}) × (y_{j+1}-y_{j}) × (z_{k+1}-z_{k})

as i j and k run through the points in the nets x y and z
We are really taking the cross product of all three nets.

If all three nets have granularity δ,
the entire Riemann net, in 3 dimensions, has granularity δ.

The Riemann sum can be applied to an arbitrary region in space.
Include only the points in the net that are contained in the region,
or, set f = 0 outside the region.
For example, let the set S be the unit ball in 3 space.
A cube of size 2 contains this ball.
All three cordinates run from -1 to 1.
Define 3 nets of granularity δ over [-1,1]
and take their cross product.
When computing the Riemann sum, include only those points
that are less than one unit away from the origin,
i.e. the points in S.

When computing a Riemann sum,
the function f() can be a complex or vector function.
Riemann sums are computed per component.