\chapter{Riemann integration}



Though the idea of a Riemann integral is just cutting up the domain, fitting rectangles to each section of the domain to fit the function and taking the area, it takes quite a lot of definitions and formalism to state mathematically.

\begin{definition}[Interval partition]
An \emph{interval partition of $[a,b]$} is a strictly monotone increasing sequence where the first and last terms of the sequence equal the endpoints of the interval.
\[\mathcal{P} = (x_k)^{n}_{k=1}\]
\[ a=x_1, b=x_n\]
\end{definition}

\begin{definition}[Uniform interval partition]
A \emph{uniform interval partition of $[a,b]$} is an interval partition $\mathcal{P} = (x_k)^{n}_{k=1}$ such that $x_{i+1}= x_{i}+ \frac{b-a}{n-1}$.
\end{definition}

\begin{definition}[Mesh of a partition]
	\[ | \mathcal{P}| = \max\{ |x_i - x_{i-1}| : x_i,x_{i-1} \in \mathcal{P} \}\]
\end{definition}

- Riemann integrable function



\begin{definition}[Upper Riemann sum]
	\[U(f,\mathcal{P}) = \sum_{k=1}^{n} \sup \{ f(x) : x \in [x_{k-1},x_{k})\} (x_k -k_{k-1})\]
	\[L(f,\mathcal{P}) = \sum_{k=1}^{n} \inf\{ f(x) : x \in [x_{k-1},x_{k})\} (x_k -k_{k-1})\]
\end{definition}

\begin{definition}[Upper Riemann integral]
	\[ \overline{\int^{b}_{a}} f = \inf \{ U(f,\mathcal{P}) : \mathcal{P} \text{ is a partition of } [a,b] \}\]
	\[ \underline{\int^{b}_{a}} f = \sup \{ L(f,\mathcal{P}) : \mathcal{P} \text{ is a partition of } [a,b] \}\]
\end{definition}




\begin{definition}[Riemann integrable function]
\[f \text{ is Riemann integrable on } [a,b] \iff  \overline{\int^{b}_{a}} f = \underline{\int^{b}_{a}} f  \]
\end{definition}


\begin{definition}[Riemann integal]
Let $f$ be a Riemann integrable on $[a,b]$, then \emph{Riemann integral of $f$ on $[a,b]$} is the following.
\[\int^{b}_{a} f(x)dx = \overline{\int^{b}_{a}} f \]
\end{definition}



Unlike differentiation, modern authors generally all agree to use Leibniz notation for integrals (i.e the notation we've defined integration by).


In an elementary calculus course, perhaps you begin by calculating the derivatives of polynomials from the definition of the derivative. Naturally we memorize the derivatives of all elementary functions and then apply linearity, chain rule, product rule, quotient rule etc.

Such elementary courses do not go into the depth to define the Riemann integral as we have done here, and hence one doesn't practice taking a Riemann integral from 'first principles' like differentiation. Sure maybe Riemann sums were familiar, but they were most likely introduced as a numerical method rather than a rigorous foundation for the Riemann integral.

Like with differentiation, it is relatively feasible to calculate the Riemann integral of polynomials from the definition!



\begin{example}
\[\int^{1}_{0} x^2 dx\]
\end{example}

- Riemann's criterion
\begin{theorem}[Riemann's criterion]
\end{theorem}
-elementary properties of riemann integral


- fundamental theorem of calculus (FTC)
\begin{theorem}[Fundamental theorem of calculus (FTC; 1)]
	\[ \frac{d}{dx}\int^{x}_{0} f(t)dt = f(x) \]
\end{theorem}

\begin{theorem}[Fundamental theorem of calculus (FTC; 2)]
\[ \int^{b}_{a} f(x)dx = F(b)-F(a) \]
\end{theorem}


These 2 theorems are irrefutably the backbone of modern science. They also make it worthwile to study the antiderivative of functions, since these are used in the calulation of integrals by these theorems.

We can try and 'reverse' the product rule and chain rule to end up with the following 2 propositions.

\begin{theorem}[Integration by parts (reverse product rule)]
\[\int F(x)g(x) dx = F(x)G(x) - \int f(x)G(x) dx\]
\end{theorem}

\begin{theorem}[Integration by substitution (reverse chain rule)]
\[\int (f \circ u)(x) u'(x) dx = \int f(u) du\]
\end{theorem}

Here is a table of standard integrals.
$\int \frac{f'(x)}{f(x)}dx = \ln|f(x)|+C$
$\int x^n dx = \frac{x^{n+1}}{n+1}+C$
$\int \cos(x) dx = \sin(x)+C$
$\int \sin(x) dx = -\cos(x)+C$
$\int e^x dx = e^x+C$
$\int a^x dx = \frac{1}{\ln(a)}a^x+C$
$\int \frac{1}{x} dx = \ln|x|+C$
$\int \sec^2 (x) dx = \tan(x)+C$
$\int \ln (x) dx = x\ln(x)-x+C$
$\int \tan (x) dx = -\ln|\cos(x)|+C$
$\int \sec(x) dx = \ln|\sec(x)+\tan(x)|+C$
$\int \frac{a}{a^2 +x^2} dx = \tan^{-1}(\frac{x}{a}) +C$
$\int \frac{1}{\sqrt{a^2 -x^2}} dx = \sin^{-1}(\frac{x}{a}) +C$



\begin{theorem}[Integral mean value theorem]
Let $f$ be continuous rela function on the closed interval $[a,b]$. There exists some $c \in [a,b]$ such that $f(c)=\frac{1}{b-a}\int^{b}_{a} f(x)dx$
\end{theorem}

\section{Improper Riemann integral}

The Riemann integral has some formal shortcomings that can be patched up by defining other integrals that are direct extensions of the  RIemann integral.

One problem is that domains of infinite length (i.e going from some number to infinity) can't be evaluated as Riemann integrals, so the improper Riemann integral considers the limit of Riemann integrals with the domain growing towards infinity.


\section{Cauchy principle value (CPV)}

The Riemann integral cannot exist on domains on which there are singularities; for example, the Riemann integral $\int^{2}_{-2}-\ln|x| dx$ is actually undefined!
\begin{definition}[Cauchy principle value (CPV)]
The \emph{cauchy principle value} is the following integral defined in terms of the limit of the following 2 Riemann integrals.
\[ \mathrm{CPV} \int^{c}_{a} f(x)dx  = \lim_{\varepsilon \to 0} \int^{b-\varepsilon}_{a} f(x)dx + \int^{c}_{b+\varepsilon} f(x)dx\]
\end{definition}



\section{Riemann-Stieltjes integration}
\subsection{Euler-MacLaurin summation}


