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.

The Cartesian coordinates x and y can be converted to polar coordinates r and φ with r ≥ 0 and φ in the interval (−π, π] by:


 * $$r = \sqrt{x^2 + y^2} \quad$$ (as in the Pythagorean theorem or the Euclidean norm), and
 * $$\varphi = \operatorname{atan2}(y, x) \quad$$,

where atan2 is a common variation on the arctangent function defined as
 * $$\operatorname{atan2}(y, x) =

\begin{cases} \arctan(\frac{y}{x}) & \mbox{if } x > 0\\ \arctan(\frac{y}{x}) + \pi & \mbox{if } x < 0 \mbox{ and } y \ge 0\\ \arctan(\frac{y}{x}) - \pi & \mbox{if } x < 0 \mbox{ and } y < 0\\ \frac{\pi}{2} & \mbox{if } x = 0 \mbox{ and } y > 0\\ -\frac{\pi}{2} & \mbox{if } x = 0 \mbox{ and } y < 0\\ \text{undefined} & \mbox{if } x = 0 \mbox{ and } y = 0 \end{cases}$$ References