\section{Curves}
In the following sections we review results from calculus of sevral variables like curves, surfaces, vector fields, and curve integrals. For more information on the subject the reader can consult the text on calculus of several variables by Lang~\cite{lang87}.

Consider a bug moving along a curve in $n$-dimensional space. The position of the bug at time $t$ can be described by $n$ coordinates
\[
\left[\begin{array}{c}
x_1(t)\\
x_2(t)\\
\vdots\\
x_n(t)
\end{array}\right].
\]
We use an abbreviated notation
\[
\b x(t)=\left[\begin{array}{c}
x_1(t)\\
x_2(t)\\
\vdots\\
x_n(t)
\end{array}\right].
\]
For example, if the bug is moving along a straight line passing through fixed points $\b y$ and $\b z$ in $\mb{\Bb R}^n$, then
\[
\b x(t)=\b y+t\b z.
\]

As another example, consider
\[
\b x(t)=\left[\begin{array}{c}
x_1(t)\\
x_2(t)
\end{array}\right]=\left[\begin{array}{c}
\cos t\\
\sin t
\end{array}\right] \in \mb{\Bb R}^2.
\]
Then, the bug moves around a circle of radius 1 in counterclockwise direction as shown in Figure~\ref{fig:bug_two}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/bug_2.bmp x=4in y=3in}
\caption{An example of a curve in two-dimensional space.}
\label{fig:bug_two}
\end{figure}
We used $t$ as the variable corresponding to the angle corresponding to the position of the bug on the circle. We are now ready for a formal definition of a curve.
\begin{defn}
Let $I \in \mb{\Bb R}$ be an interval. A parametrized curve defined on the interval $I$ is an association which to each point of $I$ associates a vector, where $\b x(t)$ denotes the vector associated to $t \in I$ by $\b x$. We write the association $t \mapsto \b x(t)$ as
\[
\b x :I \to \mb{\Bb R}^n.
\]
We also call this association the parametraization of a curve. We call $\b x(t)$ the position vector at time $t$. It can be written in terms of coordinates as
\[
\b x(t)=\left[\begin{array}{c}
x_1(t)\\
x_2(t)\\
\vdots\\
x_n(t)
\end{array}\right],
\]
where each component $x_i(t)$ is a function of time $t$. We say that this curve is differentiable if each function $x_i(t)$ is a differentiable function of time $t$.
\end{defn}
We define the derivative $d\b x(t)/dt$ to be
\[
\dot{\b x}(t)=\frac{d \b x(t)}{dt}=\left[\begin{array}{c}
\frac{d x_1(t)}{dt}\\
\frac{d x_2(t)}{dt}\\
\vdots\\
\frac{d x_n(t)}{dt}
\end{array}\right],
\]
and call it the velocity vector of the curve at time $t$. The velocity vector is located at the origin. However, when we translate it to the point $\b x(t)$, as in Figure~\ref{fig:velocity}, then we visualize it as tangent to the curve $\b x(t)$.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/veloc.bmp x=4in y=3in}
\caption{A velocity vector of a curve at time {\it t} is parallel to a tangent vector at time {\it t}.}
\label{fig:velocity}
\end{figure}

We define the tangent line to a curve $\b x$ at time $t$ to be the line passing throught $\b x(t)$ in the direction of $\dot{\b x}(t)$, provided $\dot{\b x}(t) \ne \b 0$. If $\dot{\b x}(t) = \b 0$, we do not define a tangent line.
The speed of the curve $\b x(t)$, denoted by $v(t)$ is
\[
v(t)=\left\Arrowvert \dot{\b x}(t) \right\Arrowvert.
\]
To illustrate the above consider the bug moving on the circle
\[
\b x(t)=\left[\begin{array}{cc}
\cos t & \sin t
\end{array}\right]^T.
\]
The velocity vector of the curve at time t is
\[
\b x(t)=\left[\begin{array}{cc}
-\sin t & \cos t
\end{array}\right]^T,
\]
and the speed of the curve $\b x(t)$ at time $t$ is
\[
v(t)=\left\Arrowvert \dot{\b x}(t) \right\Arrowvert=\sqrt{(-\sin t)^2 + \cos ^2 t}=1.
\]

\section{Surfaces}
The set of points in $\mb{\Bb R}^3$ such that for some $F:\mb{\Bb R}^3 \to \mb{\Bb R}$ we have
\[
F(\b x)=f(x_1,x_2,x_3)=0,\quad \mb{and} \nabla F(x_1,x_2,x_3) \ne \b 0,
\]
is called a surface in $\mb{\Bb R}^3$. For example, let
\[
F(x_1,x_2,x_3)=x_1^2+x_2^2+x_3^2-1,
\]
then, the surface is the sphere of radius 1, centered at the origin of $\mb{\Bb R}^3$.

An alternative way to represent a surface in $\mb{\Bb R}^3$ is via the equation
\[
x_3=f(x_1,x_2),
\]
or in parametric fashion as follows
\begin{eqnarray*}
x_1 &=& p(u,v)\\
x_2 &=& q(u,v)\\
x_3 &=& r(u,v),
\end{eqnarray*}
where the Jacobian matrix
\[
\frac{\partial (x_1,x_2,x_3)}{\partial (u,v)} \in \mb{\Bb R}^{3\times 2}
\]
is of rank 2.

In general case, that is, for $\mb{\Bb R}^n$, a surface can be described in three eqiuvalent ways as follows:
\begin{itemize}
\item[(a)] \begin{eqnarray*}
F_1(x_1,x_2,\ldots,x_n) &=& 0\\
F_2(x_1,x_2,\ldots,x_n) &=& 0\\
{}&\vdots&{}\\
F_m(x_1,x_2,\ldots,x_n) &=& 0,
\end{eqnarray*}
where $m<n$, or using abbreviated notation as
\[
\b F(\b x)=\b 0,
\]
where $\b F:\mb{\Bb R}^n \to \mb{\Bb R}^m$.
\item[(b)] \begin{eqnarray*}
x_{n-m+1} &=& f_{n-m+1}(x_1,x_2,\ldots,x_{n-m})\\
x_{n-m+2} &=& f_{n-m+2}(x_1,x_2,\ldots,x_{n-m})\\
{}&\vdots&{}\\
x_{n} &=& f_{n}(x_1,x_2,\ldots,x_{n-m}),
\end{eqnarray*}
\item[(c)] \begin{eqnarray*}
x_1 &=& g_1(u_1,u_2,\ldots,u_{n-m})\\
x_2 &=& g_2(u_1,u_2,\ldots,u_{n-m})\\
{}&\vdots&{}\\
x_n &=& g_n(u_1,u_2,\ldots,u_{n-m}).
\end{eqnarray*}
\end{itemize}

Let now
\[
\b C(t)=\left[\begin{array}{cccc}
x_1(t) & x_2(t) & \cdots & x_n(t)
\end{array}\right]^T
\]
be a differentaibale curve. We say the the curve lies on the surface described by
\begin{eqnarray*}
F_1(x_1,x_2,\ldots,x_n) &=& 0\\
F_2(x_1,x_2,\ldots,x_n) &=& 0\\
{}&\vdots&{}\\
F_m(x_1,x_2,\ldots,x_n) &=& 0,
\end{eqnarray*}
if, for all $t$, we have
\begin{eqnarray*}
F_1(x_1(t),x_2(t),\ldots,x_n(t)) &=& 0\\
F_2(x_1(t),x_2(t),\ldots,x_n(t)) &=& 0\\
{}&\vdots&{}\\
F_m(x_1(t),x_2(t),\ldots,x_n(t)) &=& 0.
\end{eqnarray*}
Differentiating the above equations, using the chain rule, we obtain
\[
\nabla^T F_i\left( \b C(t)\right)\dot{\b C}(t)=0,\quad i=1,2,\ldots,m.
\]
Let $\b x_0$ be a point of the surface, and let $\b C(t)$ be a curve on the surface passing through $\b x_0$, that is, for some $t_0$ we have
\[
\b C(t_0)=\b x_0.
\]
For this $t_0$ we have
\[
\nabla^T F_i\left( \b x_0\right)\dot{\b C}(t_0)=0,\quad i=1,2,\ldots,m,
\]
where we assumed that $\dot{\b C}(t_0)\ne \b 0$. Thus, the gradients $\nabla F_i$ at $\b x_0$ are perpendicular to the tangent vector of the curve at the point $\b x_0$. This is true for every differentaible curve on the surface passing through $\b x_0$. For an illustration of the above properties in three-dimensional space we refer to Figure~\ref{fig:tangent}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/tangent.bmp x=4in y=3in}
\caption{Tangent space to a surface is the set of vectors perpendicular to gradients of the functions defining the surface.}
\label{fig:tangent}
\end{figure}
\begin{defn}
The tangent space to the surface $\left\{ \b x:\b F(\b x)=\b 0\right\}$ at the point $\b x_0$ is the set of of vectors at $\b x_0$ that are tangent to some differentiable curve on the surface passing through $\b x_0$.
\end{defn}

\section{Vector Fields}
\begin{defn}
Let ${\cal U}$ be an open subset of $\subset \mb{\Bb R}^n$. By a vector field on ${\cal U}$ we mean an association
\[
\b F:{\cal U} \to \mb{\Bb R}^n
\]
which to every point of $\subset {\cal U}$ associates a vector of the same dimension.
\end{defn}
We can interpret a vector filed as a field of forces. We can visualize a vector field as a filed of arrows, which to each point associates an arrow as shown in Figure~\ref{fig:field}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/field.bmp x=4in y=3in}
\caption{A vector field.}
\label{fig:field}
\end{figure}
If $f:{\cal U} \to \mb{\Bb R}$ is a function, then
\[
\b F=\nabla f
\]
is a vector field, and we have
\[
\b F(\b x)=\nabla f(\b x)
\]
for all $\b x \in {\cal U}$. We now consider an inverse problem: When is a given vector field in $\mb{\Bb R}^n$ a gradient?
\begin{defn}
Let $\b F$ be a vector field on an open set ${\cal U}$. If $f$ is a differentiable function on ${\cal U}$ such that
\[
\b F=\nabla f,
\]
then we say that $f$ is a potential function for $\b F$.
\end{defn}
We then can ask the question if the potential functions exist. We can recast the problem as the one involving solving $n$ first order partial differential equations:
\[
\frac{\partial f}{\partial x_i}=F_i(\b x),\quad i=1,2,\ldots,n,
\]
with the initial condition
\[
\b F(\b x_0)=\b F_0.
\]
To answer the above question we need one more definition.
\begin{defn}
An open set ${\cal U}$ is said to be connected if, given two points in ${\cal U}$, there is a differentiable curve in ${\cal U}$ which joins the two points.
\end{defn}
If ${\cal U}=\mb{\Bb R}^n$, then any two points can be joind by a straight line. Of course, it is not always the case that two points of an open set can be joined by a straight line, as it is illustrated in Figure~\ref{fig:connect}.
\begin{figure}
\vskip3in
\hskip1in\special{bmp:c:/mybook/connect.bmp x=4in y=3in}
\caption{A connected open set in which there are points that cannot be joined by a straight line.}
\label{fig:connect}
\end{figure}
\begin{thm}
Let $\b F(\b x)$ be ${\cal C}^1$ function defined on an open connected region ${\cal U}$ of $\mb{\Bb R}^n$. Then, there is a solution to the differential equation
\[
\frac{\partial f}{\partial \b x}=\b F(\b x),\quad \b F(\b x_0)=\b F_0
\]
if, and only if,
\[
\frac{\partial F_i}{\partial x_j}=\frac{\partial F_j}{\partial x_i},
\]
that is, the Jacobian matrix of $\b F$ is symmetric.
\end{thm}
{\bf Proof}\quad We prove the theorem for $n=2$, where the connected region ${\cal U}$ is a rectangle. We select a point $\b x_0=[x_{10} x_{20}]^T$ in the rectangle. We assume that $\b F=\left[\begin{array}{cc}
F_1 & F_2
\end{array}\right]^T$ and that
\[
D_2F_1=D_1F_2,\quad\mb{that is}\quad \frac{\partial F_1}{\partial x_2}=\frac{\partial F_2}{\partial x_1}.
\]
Our goal is to find a potential function $f(x_1,x_2)$. We assume that the potential function has the form
\[
f(x_1,x_2)=\int_{x_{10}}^{x_1}F_1(s,x_2)ds + u(x_2),
\]
where $u(x_2$ is a function of $x_2$ only and will be determined later in the proof. We illustrate the integration path in Figure~\ref{fig_intpath}.
\begin{figure}
\vspace{3in}
\hskip1in\special{bmp:c:/mybook/intpath.bmp x=4in y=3in}
\caption{Integration path used in the proof of the theorem.}
\label{fig_intpath}
\end{figure}
Applying the fundamental theorem of calculus, we obtain
\begin{eqnarray*}
\frac{\partial f}{\partial x_1} &=& \frac{\partial}{\partial x_1}\int_{x_{10}}^{x_1}F_1(s,x_2)ds + \frac{\partial u(x_2)}{\partial x_2}\\
&=& F_1(x_1,x_2)
\end{eqnarray*}
because
\[
\frac{\partial u(x_2)}{\partial x_2}=0.
\]
Hence,
\[
D_1f(x_1,x_2)=F_1(x_1,x_2)
\]
as required. We now diferentiate $f(x_1,x_2)$ with respect to $x_2$ to get
\begin{eqnarray*}
\frac{\partial f}{\partial x_2} &=& \int_{x_{10}}^{x_1}\frac{\partial F_1(s,x_2)}{\partial x_2}ds+\frac{\partial u(x_2)}{\partial x_2}\\
&=& \int_{x_{10}}^{x_1}\frac{\partial F_2(s,x_2)}{\partial x_1}ds+\frac{\partial u(x_2)}{\partial x_2}
\end{eqnarray*}
because $D_2f=D_1f$. Therefore,
\begin{eqnarray*}
\frac{\partial f}{\partial x_2} &=& \left. F_2(s,x_2)\right\arrowvert_{x_{10}}^{x_1}+\frac{\partial u(x_2)}{\partial x_2}\\
&=& F_2(x_1,x_2)-F_2(x_{10},x_2)+\frac{\partial u(x_2)}{\partial x_2}.
\end{eqnarray*}
Let
\[
-F_2(x_{10},x_2)+\frac{\partial u(x_2)}{\partial x_2}=0,
\]
that is, $\frac{\partial u(x_2)}{\partial x_2}=F_2(x_{10},x_2)$.
Then, $D_2f=F_2$ as wanted. To conclude the proof we let
\[
u(x_2)=\int F_2(x_{10},x_2)dx_2,
\]
which yields
\[
f(x_1,x_2)=\int_{x_{10}}^{x_1}F_1(s,x_2)ds+\int_{x_{20}}^{x_2}F_2(x_{10},t)dt.
\]
The proof is complete for $n=2$.\\
\hspace*{5.5in} $\Box$

We note that if the connected region ${\cal U}$ is an arbitrary open set, then the above proof may not work. This is because we needed to integrate over intervals that were contained in the region ${\cal U}$.

\section{Curve Integrals}
Suppose we are given a vector field $\b F$ on an open set $U$ in the plane. Let us interpret $\b F$ as a field of forces. We wish to calculate the work done when moving a particle from a point $\b C(t_1)$ to a point $\b C(t_2)$ along the curve $\b C(t)$ in $U$, as illustrated in Figure~\ref{fig_curveint}.
\begin{figure}
\vspace{3in}
\hskip1in\special{bmp:c:/mybook/curveint.bmp x=4in y=3in}
\caption{A particle moving along a curve in vector field.}
\label{fig_curveint}
\end{figure}
Let
\[
\b F(\b x)=\left[\begin{array}{cc}
F_1(x_1,x_2) & F_2(x_1,x_2)
\end{array}\right]^T.
\]
We assume that each component of $\b F$ is differentiable, that is, $\b F$ is a differentiable vector field.

We next assume that the curve $\b C(t)$ is defined on a closed interval $[t_1,t_2]$ with $t_1<t_2$. For each $t \in [t_1,t_2]$ the value $\b C(t)$ is a point in $\mb{\Bb R}^2$. The curve $\b C$ lies in $U$ if $\b C(t)$ is a point in $U$ for all $t \in [t_1,t_2]$. The curve $\b C$ is continuously differentiable if its derivative $\dot{\b C}(t)=\frac{d\b C(t)}{dt}$ exists and is continuous, that is, we assume that $\b C \in C^1$.

We define the integral of $\b F$ along $\b C$ to be
\begin{eqnarray*}
\int_{\b C}\b F &=& \int_{t_1}^{t_2}\b F^T(\b C(t))\frac{d \b C}{dt}dt\\
&=& \int_{t_1}^{t_2}\b F^T(\b C(t))d\b C,
\end{eqnarray*}
which is the work done against the force field $\b F$ along the curve $\b C$. Let
\[
\b C(t)=\left[\begin{array}{cc}
x_1(t) & x_2(t)
\end{array}\right]^T,
\]
then we can write
\[
\int_{\b C}\b F =\int_{\b C}F_1dx_1+F_2dx_2.
\]
\begin{thm}[Green's Theorem]
Let the vector field $\b F$ be  given on a region $A$ that is the interior of a closed path $\b C$ parametrized counterclocwise. Then,
\[
\int_{\b C}F_1dx_1+F_2dx_2=\int\!\!\!\int_{A}\left( \frac{\partial F_2}{\partial x_1}-\frac{\partial F_1}{\partial x_2}\right)dx_1dx_2.
\]
\end{thm}
