Project:VisualEditor testing/TestMath

Let f : D → R be a function defined on a subset, D, of the real line, R. Let I = [a, b] be a closed interval contained in D, and let
 * $$P= \left \{[x_0,x_1),[x_1,x_2),\dots,[x_{n-1},x_{n}] \right \},$$

be a partition of I, where
 * $$a=x_0<x_1<x_2<\cdots<x_n=b.$$

The Riemann sum of f over I with partition P is defined as
 * $$S = \sum_{i=1}^{n} f(x_i^*)(x_{i}-x_{i-1}), \quad x_{i-1}\le x_i^* \le x_i.$$

The choice of $$x_i^*$$ in the interval $$[x_{i-1},x_i]$$ is arbitrary.

Example: Specific choices of $$x_i^*$$ give us different types of Riemann sums:
 * If $$x_i^*=x_{i-1}$$ for all i, then S is called a left Riemann sum.
 * If $$x_i^*=x_i$$ for all i, then S is called a right Riemann sum.
 * If $$x_i^*=\tfrac{1}{2}(x_i+x_{i-1})$$ for all i, then S is called a middle Riemann sum.
 * The average of the left and right Riemann sum is the trapezoidal sum.
 * If it is given that
 * $$S = \sum_{i=1}^{n} v_i(x_{i}-x_{i-1}),$$
 * where $$v_i$$ is the supremum of f over $$[x_{i-1},x_i]$$, then S is defined to be an upper Riemann sum.


 * Similarly, if $$v_i$$ is the infimum of f over $$[x_{i-1},x_i]$$, then S is a lower Riemann sum.