\newsectionNoPB
\subsection{Riemann integral in Vector Space}
The integral of a continuous function $f: X \rightarrow \R$ with $X \subseteq \R^n$ bounded and closed, is denoted $\int_X f(x) \dx x$ with properties:
\rmvspace
\begin{enumerate}[label=(\arabic*), noitemsep]
    \item \bi{(Compatibility)} If $n = 1$ and $X = [a, b]$, integral is the indefinite integral as per Analysis I
    \item \bi{(Linearity)} If $f$, $g$ are continuous on $X$ and $a, b \in \R$, then $\displaystyle \int_X (a f(x) + b g(x)) \dx x = a \int_X f(x) \dx x + b \int_X g(x) \dx x$
    \item \bi{(Positivity)} If $f \leq g$, then so is the integral and if $f \geq 0$, so is the integral and if $Y \subseteq X$, then int. over $Y$ is $\leq$ over $X$
    \item \bi{(Upper bound \& Triangle Inequality)} $\displaystyle \left| \int_{X} f(x) \dx x \right| \leq \int_{X} |f(x)|\dx x$ and
          $\displaystyle \left| \int_{X} (f(x) + g(x)) \dx x \right| \leq \int_{X} |f(x)| \dx x \int_X |g(x)|$
    \item \bi{(Volume)} The integral of $f$ is the volume of $\{ (x, y) \in X \times \R : 0 \leq y \leq f(x) \} \subseteq \R^{n + 1}$.
          If $X$ is a bounded rectangle, e.g. $X = [a_1, b_1] \times \ldots \times [a_n, b_n] \subseteq \R^n$ and $f = 1$, then $\int_{X} \dx x = (b_n - a_n) \dots (b_1 - a_1)$.
          We write $\text{Vol}(X)$ or $\text{Vol}_n(X)$
    \item \bi{(Multiple integral)} \textit{(Fubini)} If $n_1, n_2 \in \Z$ s.t. $n = n_1 + n_2$,
          then for $x_1 \in \R^{n_1}$, let $Y_{x_1} = \{ x_2 \in \R^{n_2} : (x_1, x_2) \in X \} \subseteq \R^{n_2}$.
          Let $X_1$ be the set of $x_1 \in \R^n$ such that $Y_{x_1}$ is not empty. Then $X_1$ and $Y_{x_1}$ are compact.\\
          If $\displaystyle g(x_1) = \int_{Y_{x_1}} f(x_1, x_2) \dx x_2$ is continuous on $X_1$, then
          \dnrmvspace
          \begin{align*}
              \int_{X} f(x_1, x_2) \dx x = \int_{X_1} g(x_1) \dx x = \int_{X_1} g(x_1) \dx x_1 = \int_{X_1} \left( \int_{Y_{x_1}} f(x_1, x_2) \dx x_2 \right) \dx x_1
          \end{align*}

          \rmvspace
          Exchanging the role of $x_1$ and $x_2$ we have (with $Z_{x_2} = \{ x_1 : (x_1, x_2) \in X \}$) if integral over $x_1$ is continuous.
          \rmvspace
          \begin{align*}
              \int_{X} f(x_1, x_2) \dx x = \int_{X_2} \left( \int_{Z_{x_2}} f(x_1, x_2) \dx x_1 \right) \dx x_2
          \end{align*}
          \drmvspace
    \item \bi{(Domain additivity)} If $X_1$ and $X_2$ are compact and $f$ continuous on $X = X_1 \cup X_2$, then (for $Y = X_1 \cap X_2$)
          \rmvspace
          \begin{align*}
              \int_X f(x) \dx x + \int_Y f(x) \dx x = \int_{X_1} f(x) \dx x + \int_{X_2} f(x) \dx x
          \end{align*}

          \rmvspace
          In particular, if $Y$ empty (or size is ``negligible''), then $\int_{X} f(x) \dx x = \int_{X_1} f(x) \dx x + \int_{X_2} f(x) \dx x$
\end{enumerate}
%
\setLabelNumber{all}{3}
\shortdef For $m \leq n \in \N$, a \bi{parametrized $m$-set} in $\R^n$ is a continuous map $f: [a_1, b_1] \times \ldots \times [a_m, b_m] \rightarrow \R^n$,
which is $C^1$ on $]a_1, b_1[ \times \ldots \times ]a_m, b_m[$.
$B \subseteq \R^n$ is \bi{negligible} if $\exists k \geq 0 \in \Z$ and parametrized $m_i$-sets $f_i: X_i \rightarrow \R^n$ with $1 \leq i \leq k$ and $m_i < n$ s.t.
$X \subseteq f_1(x_1) \cup \ldots \cup f_k(X_k)$. A parametrized $1$-set in $\R^n$ is a parametrized curve.
\shortex Any $\R \times \{ 0 \} \subseteq \R^2$ is negligible in $\R^2$, or more generally,
if $H \subseteq \R^n$ is an affine subspsace of dimension $m < n$, then any subset of $\R^n$ that is contained in $H$ is negligible.
Image of par. curve $\gamma: [a, b] \rightarrow \R^n$ is negligible, since $\gamma$ is a $1$-set in $\R^n$\\
%
\shortproposition $X$ compact set, negligible. Then for any cont. function on $X$, $\displaystyle\int_{X} f(x) \dx x = 0$

\mrmvspace
\shade{gray}{Computing it}
\bi{How to find the actual integrals from the intervals:} \hl{(Be careful with order of $x$ and $y$!)}
\rmvspace
\begin{itemize}[noitemsep]
    \item Given an integral $\int_{D} f(x, y) \dx x \dx y$ for a set (or region) $X$ that is bounded by the coordinate axes and the line $x + y = 2$,\
          the integral we can actually compute is $\int_{0}^{2} \int_{0}^{2} f(x, y) \dx y \dx x$.
    \item Given an integral $\int_{X} g(x, y) \dx x \dx y$ with $X = [0, 1] \times [0, 2]$ and $g(x) = x^2 + y^2$. Then the integral should be obvious:
          $\int_{0}^{1} \int_{0}^{2} g(x, y) \dx y \dx x$
    \item \textit{Harder example} Given integral $\int_Y h(x, y) \dx x \dx y$ with $Y = \{ (x, y) \divides x \in [0, 1], y \leq 2x \land y \geq -2x \}$.
          A good idea is to visualize the set: This one is a triangle and the integral is
          $\int_{0}^{1} \int_{-2x}^{2x} h(x, y) \dx y \dx x$
    \item \textit{Non-obvious example} For a set $U = \{ (x, y) : \sqrt{ x^2 + y^2 } \leq R \}$, we have the integral
          $\displaystyle \int_{-R}^{R} \int_{-\sqrt{R^2 - x^2}}^{\sqrt{R^2 - x^2}} 1 \dx y \dx x$.
          The new limits were attained by a simple inequality transformation, because in such equations, $y$ could be $0$ (and thus $|x|$ is limited by $R$)
\end{itemize}

\rmvspace
\bi{How to compute the integral:} We compute each integral "inside out". For a definite integral, don't just find the anti-derivative, compute the actual integral!
For an integral as seen in the harder example, we compute it as we normally would, simply using the $\pm 2x$ as the $a$ and $b$.
For \bi{set unions} (i.e. $S = A \cup B$): $\int_{A} f(\vec{x}) \dx \vec{x} + \int_B f(\vec{x}) \dx \vec{x}$

Using a change of variables into polar coordinates may come in handy, e.g. for a set like $\{ (x, y) \in \R^2 \divides 1 \leq x^2 + y^2 \leq 4 \}$,
we can use polar coordinates and the integral is then $\int_{0}^{2\pi} \int_{1}^{2} f(x, y) \dx r \dx \varphi$ (or flipped of course)

\rmvspace
