# Riemann integral/Above and below/Section
## Definition

Let $I$ denote a compact interval and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function. Then $f$ is called Riemann-integrable if the upper integral and the lower integral
$f$
It might by historically more adequate to call this Darboux-integrable.

## Definition

Let $I=[a,b]$ denote a compact interval. For a Riemann-integrable function
    $f\colon I=[a,b]\longrightarrow \mathbb {R} ,t\longmapsto f(t),$
we call the upper integral of $f$ (which by definition coincides with the lower integral) the definite integral of $f$ over $I$. It is denoted by
    $\int _{a}^{b}f(t)\,dt{\text{ or by }}\int _{I}^f(t)\,dt.$
The computation of such integrals is called to integrate. Don't think too much about the symbol $dt$. It expresses that we want to integrate with respect to this variable. The name of the variable is not relevant, we have
    $\int _{a}^{b}f(t)\,dt=\int _{a}^{b}f(x)\,dx\,.$

## Lemma

Let $I$ denote a compact interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function. Suppose that there exists a sequence of lower step functions ${\left(s_{n}\right)}_{n\in \mathbb {N} }$ with $s_{n}\leq f$ and a sequence of upper step functions ${\left(t_{n}\right)}_{n\in \mathbb {N} }$ with $t_{n}\geq f$. Suppose furthermore that the corresponding sequences of step integrals converge to the same real number. Then $f$ is Riemann-integrable, and the definite integral equals this limit, so
    $\lim _{n\rightarrow \infty }\int _{a}^{b}s_{n}(x)\,dx=\int _{a}^{b}f(x)\,dx=\lim _{n\rightarrow \infty }\int _{a}^{b}t_{n}(x)\,dx\,.$

### Proof

$\Box$

## Example

We consider the function
    $f\colon [0,1]\longrightarrow \mathbb {R} ,t\longmapsto t^{2},$
which is strictly increasing in this interval. Hence, for a subinterval $[a,b]\subseteq [0,1]$, the value $f(a)$ is the minimum, and $f(b)$ is the maximum of the function on this subinterval. Let $n$ be a positive natural number. We partition the interval $[0,1]$ into the $n$ subintervals $\left[i{\frac {1}{n}},(i+1){\frac {1}{n}}\right]$, $i=0,\ldots ,n-1$, of length ${\frac {1}{n}}$. The step integral for the corresponding lower step function is
    $\sum _{i=0}^{n-1}{\frac {1}{n}}{\left(i{\frac {1}{n}}\right)}^{2}={\frac {1}{n^{3}}}\sum _{i=0}^{n-1}i^{2}={\frac {1}{n^{3}}}{\left({\frac {1}{3}}n^{3}-{\frac {1}{2}}n^{2}+{\frac {1}{6}}n\right)}={\frac {1}{3}}-{\frac {1}{2n}}+{\frac {1}{6n^{2}}}\,$
(see exercise for the formula for the sum of the squares). Since the sequences ${\left(1/2n\right)}_{n\in \mathbb {N} }$ and ${\left(1/6n^{2}\right)}_{n\in \mathbb {N} }$ converge to $0$, the limit for $n\rightarrow \infty$ of these step integrals equals ${\frac {1}{3}}$. The step integral for the corresponding step function from above is
    $\sum _{i=0}^{n-1}{\frac {1}{n}}{\left((i+1){\frac {1}{n}}\right)}^{2}={\frac {1}{n^{3}}}\sum _{i=0}^{n-1}(i+1)^{2}={\frac {1}{n^{3}}}\sum _{j=1}^{n}j^{2}={\frac {1}{n^{3}}}{\left({\frac {1}{3}}n^{3}+{\frac {1}{2}}n^{2}+{\frac {1}{6}}n\right)}={\frac {1}{3}}+{\frac {1}{2n}}+{\frac {1}{6n^{2}}}\,.$
The limit of this sequence is again ${\frac {1}{3}}$. By fact, the upper integral and the lower integral coincide, hence the function is Riemann-integrable, and for the definite integral we get
    $\int _{0}^{1}t^{2}\,dt={\frac {1}{3}}\,.$

## Lemma

Let $I=[a,b]$ be a compact interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
* The function $f$ is Riemann-integrable.
* There exists a partition $a=a_{0}<a_{1}<\cdots <a_{n}=b$, such that the restrictions $f_{i}:=f|_{[a_{i-1},a_{i}]}$ are Riemann-integrable.
* For every partition $a=a_{0}<a_{1}<\cdots <a_{n}=b$, the restrictions $f_{i}:=f|_{[a_{i-1},a_{i}]}$ are Riemann-integrable.
    $\int _{a}^{b}f(t)\,dt=\sum _{i=1}^{n}\int _{a_{i-1}}^{a_{i}}f_{i}(t)\,dt\,$

### Proof

$\Box$

## Definition

Let $f\colon I\rightarrow \mathbb {R}$ be a function on a real interval. Then $f$ is called Riemann-integrable, if the restriction of $f$ to every compact interval $[a,b]\subseteq I$ is
Due to this lemma, both definitions coincide for a compact interval $[a,b]$. The integrability of a function $f\colon \mathbb {R} \rightarrow \mathbb {R}$ does not mean that $\int _{\mathbb {R} }f(x)dx$ has a meaning or exists.