\ifdefined\inmaster\else\def\subonly{\jobname}\input{calc3}\fi

\chapter{Line integrals}
\label{cha:line-integrals}

We introduced differential forms by saying that when you wrote
\[ \itint x a b {f(x)} \]
in one-variable calculus, you were actually integrating not the function $f$ but the differential form $f(x)\,\dx$.
We will now make precise what it means to integrate a differential form, and generalize to the multivariable situation.

\section{Line integrals}
\label{sec:line-integrals}

If we want to integrate a form in more than one dimension, we have a new problem: we need more information to specify the ``interval'' over which to integrate.
The most appropriate sort of ``interval'' turns out to be a \textbf{parametrized curve} (or \emph{parametric curve}), a notion which you might have encountered in one-variable calculus.

Recall that a parametrized curve $\curve$ in two dimensions consists of a \emph{parameter interval} $[a,b]$ and two functions $\curvex(t)$ and $\curvey(t)$ defined for all $t\in [a,b]$.
The curve is then the set of points $\curvept(t) = (\curvex(t),\curvey(t))$ as $t$ ranges over some domain (we call $t$ the \emph{parameter}).
Similarly, in three dimensions we have three functions $\curvex(t)$, $\curvey(t)$, and $\curvez(t)$ and we consider the points $\curvept(t) = (\curvex(t),\curvey(t),\curvez(t))$.
We say that a parametrized curve is \textbf{continuous} or \textbf{differentiable} if the functions $\curvex$, $\curvey$, and (possibly) $\curvez$ are continuous or differentiable.
\begin{stewart}Parametrized curves are discussed in sections 1.7 and 10.1 of the textbook.\end{stewart}%
\begin{hugheshallett}Parametrized curves are discussed in sections 17.1--17.2 of the textbook.\end{hugheshallett}%
\begin{rogawski}Parametrized curves are discussed in section 11.1 of the textbook.\end{rogawski}%

Now suppose $\omega$ is a differential form in two dimensions, which we want to integrate over a parametrized curve $\curve$ defined on $[a,b]$.
We regard $\omega(\ptx,\dpx)$ as telling us about the first-order changes in some quantity Q as $\ptx$ changes to $\ptx+\dpx$, whereas we are interested in the total change of Q ``along $\curve$''.
We can approximate this total change by dividing $[a,b]$ into a large number $N$ of subintervals $[t_{i-1},t_i]$, and choosing a point $\rstag t i$ in each such subinterval.
Then if we consider the part of $\curve$ between $t_{i-1}$ and $t_i$ to be approximately a straight line, we can approximate the first-order change in Q along that part by $\omega(\curvept(\rstag t i),\Delta \curvept_i)$, where $\Delta\curvept_i = \curvept(t_i)-\curvept(t_{i-1})$.
Adding these up, we obtain the Riemann sum
\[ \sum_{i=1}^N \omega(\curvept(\rstag t i),\Delta \curvept_i) \]
and we define the \textbf{line integral} of $\omega$ over $\curve$ to be the limit of these sums, as the widths $\Delta t_i = t_i - t_{i-1}$ go to zero:
\begin{equation}
  \lint{\curve} \omega = \lim_{\Delta t_i \to 0} \sum_{i=1}^N \omega(\curvept(\rstag t i),\Delta \curvept_i).\label{eq:line-integral}
\end{equation}
(It would be more appropriate to call this a \textit{curve integral}, since $\curve$ is a curve and not usually a straight line, but the term ``line integral'' is standard.)

If the curve $\curve$ is differentiable, then we can write $\dcurvept = \curvept'(t)\,\dt$, or in components
\[\dx = x'(t)\,\dt \qquad \dy = y'(t) \,\dt \qquad \dz = z'(t)\,\dt. \]
(That is, $\curvept'(t)$ denotes the vector $(\curvex'(t),\curvey'(t))$ or $(\curvex'(t),\curvey'(t),\curvez'(t))$.)

Thus, we might expect to be able to evaluate a line integral by substituting these values in $\omega$ to get an ordinary integral in terms of $t$.
This is in fact possible, although it is not trivial to prove; it is a special case of the \emph{Change of Variables Theorem}.
Here we have another situation like the chain rule, where the notation of differentials makes a deep fact appear obvious and easy-to-use.

\begin{eg}\label{eg:lineint-cov}
  Suppose $x(t) = t^2$ and $y(t) = t^3$ define a curve in two dimensions with domain $[0,2]$, so that $\dx = 2t\,\dt$ and $\dy = 3t^2\,\dt$.
  Then we can evaluate a line integral such as
  \[ \lint{\curve} (x^2 y \,\dx - x \,\dy) \]
  by substituting these values for $x$, $y$, $\dx$, and $\dy$, obtaining the ordinary integral
  \[ \int_{t=0}^2 \Big( (t^2)^2(t^3)(2t\,\dt) - (t^2)(3t^2\,\dt)\Big)
  = \int_{t=0}^2 (2t^8 - 3t^4)\,\dt\]
  which we can evaluate using the ordinary fundamental theorem of calculus.
\end{eg}

Recall that differential forms are functions whose input is a point and a vector.
Using this, we can formally state the Change of Variables Theorem for line integrals.

\begin{thm}[Change of Variables]
  If $\curve$ is a differentiable curve with parameter in $[a,b]$, and $\omega$ is a differential form such that for each $\ptx$, the function $\omega(\ptx,\dpx)$ is Lipschitz continuous in $\dpx$, then
  \begin{equation}
    \lint{\curve} \omega = \lint{[a,b]} \omega\big(\curvept(t),\, \curvept'(t) \,\dt\big)\label{eq:lineint-chvar-2}
  \end{equation}
\end{thm}

Now suppose $\omega$ is a \emph{linear} differential form.
Recall that that means it looks like $f(\ptx)\,\dx + g(\ptx)\,\dy + h(\ptx)\,\dz$.
Then
\begin{align*}
  \omega\big(\curvept(t),\, \curvept'(t) \,\dt\big) &=
  f(\curvept(t))\,\curvept'(t) \,\dt + g(\curvept(t))\,\curvept'(t) \,\dt + h(\curvept(t))\,\curvept'(t) \,\dt\\
  &= \Big(f(\curvept(t))\,\curvept'(t) + g(\curvept(t))\,\curvept'(t) + h(\curvept(t))\,\curvept'(t)\Big) \,\dt\\
  &= \omega\big(\curvept(t),\, \curvept'(t)\big)\,\dt
\end{align*}
and thus the right-hand side of \cref{eq:lineint-chvar-2} becomes
\[ \itint t a b {\omega\big(\curvept(t),\, \curvept'(t)\big)}. \]
This is an ordinary one-variable integral of the sort we already understand.
Therefore, the line integral of any linear differential form over any differentiable curve can be reduced to a one-variable integral just as in \cref{eg:lineint-cov}, which we can at least hope to integrate using the fundamental theorem of calculus.

More generally, if $\curve$ is only \emph{piecewise} differentiable, then we can break a line integral up into several integrals and apply this method on each piece.
\begin{notextbook}Your textbook probably contains more details.\end{notextbook}%
\begin{stewart}More details are in the textbook (section 13.2).\end{stewart}%
\begin{hugheshallett}See the textbook (sections 18.1--18.2).\end{hugheshallett}%
\begin{rogawski}See the textbook (section 16.2).\end{rogawski}%

\begin{rmk}\label{rmk:lineint-orientation}
  Although we used a particular parametrization of the curve $\curve$ to define the line integral $\lint{\curve} \omega$ in \cref{eq:line-integral}, and to evaluate it as in \cref{eq:lineint-chvar-2}, in fact the value of the integral is independent of the parametrization.
  This makes sense if we look at the definition of the Riemann sums in \cref{eq:line-integral}, which depend only on the values of $\omega$ at the points $\curvept(\rstag t i)$ and the vectors $\Delta \curvept_i$; any other parametrization would induce a corresponding division into subintervals with the same points and vectors.

  It is necessary that any parametrization must traverse the curve in a specific direction, and \emph{continue} going in that direction: it cannot stop and turn around, ``re-covering'' part of the curve more than once.
  Moreover, the integral \emph{does} depend on the direction in which the parametrization traverses the curve; a choice of such a direction is called an \emph{orientation} of the curve $\curve$.
  Reversing the orientation would negate the vectors $\Delta \curvept_i$, and for a \emph{linear} differential form, this would negate the value of the integral.
  (There are some nonlinear forms whose line integrals are independent of orientation, however; we will see some in \cref{sec:arc-length}.)
\end{rmk}

Finally, recall that any vector field $\vc{v}$ gives rise to a linear differential form $\dotp{\vc{v}(\ptx)}{\dpx}$.
We can then integrate this form over any curve, obtaining a line integral denoted
\[ \lint{\curve} \dotp{\vc{v}(\ptx)}{\dpx} \]
or any number of similar notations.
\begin{notextbook}You will probably find this in your textbook.\end{notextbook}%
\begin{stewart}The textbook writes $\lint{\curve} \dotp{\vc{v}}{d\pt{r}}$ (section 13.2).\end{stewart}%
\begin{hugheshallett}The textbook writes $\lint{\curve} \dotp{\vc{v}}{d\pt{r}}$ (section 18.1).\end{hugheshallett}%
\begin{rogawski}The textbook writes $\lint{\curve} \dotp{\vc{v}}{d\pt{s}}$ (section 16.2), calling it a \textbf{vector line integral}.\end{rogawski}
This is the commonly used notation for line integrals in vector calculus, and it includes many cases of interest because many differential forms are linear.


\section{Arc length}
\label{sec:arc-length}

The most important example of a \emph{nonlinear} line integral is one that you may already have encountered in one-variable calculus: the \emph{arc length} of a parametrized curve.
To find this as an integral, we should choose $\omega$ to be a first-order approximation to the length of a bit of curve.
If we consider the curve to be approximately a line, then this would be just the length of the vector $\dpx$.
Thus, in two dimensions we should integrate the differential form
\[ \sqrt{\dx^2+\dy^2}\]
while in three dimensions we should integrate
\[ \sqrt{\dx^2+\dy^2 + \dz^2}.\]
It is traditional to denote these differential forms by $\mathrm{d}\ell$ or $\mathrm{d}s$, but this is potentially confusing because they are not the differential of anything.
\begin{stewart}(The textbook uses $ds$.)\end{stewart}%
\begin{rogawski}(The textbook uses $ds$.)\end{rogawski}
% Hughes-Hallett doesn't mention arc length integrals.
We will instead denote them by $\dl$ (note the stroke over the $\mathrm{d}$).
That is, we define
\[ \dl = \mgn{\dpx} =
\begin{cases}
  \sqrt{\dx^2+\dy^2}\qquad\text{in two dimensions}\\[3pt]
  \sqrt{\dx^2+\dy^2+\dz^2}\qquad\text{in three dimensions}.
\end{cases}\]
The form $\dl$ is sometimes called the \textbf{length element} or the \textbf{line element}.

Now the \textbf{arc length} of a curve $\curve$ is defined to be
\[ \text{arc length of } \curve = \lint{\curve} \dl \]
if this integral exists.
More generally, if $f$ is a multivariable function, then the \textbf{line integral of $f$ with respect to arc length} over $\curve$ is defined to be
\[ \lint{\curve} f(\ptx)\,\dl. \]
\begin{rogawski}The textbook calls this a \textbf{scalar line integral}.\end{rogawski}

Even though $\dl$ is not a linear differential form, it is Lipschitz continuous in $\dpx$.
Thus, the Change of Variables Theorem applies to arc length integrals, and can reduce them to one-variable integrals.
In fact, if $\dx = x'(t) \,\dt$ and $\dy = y'(t)\,\dt$, then we can write
\begin{align*}
  \dl &= \sqrt{\dx^2+\dy^2}\\
  &= \sqrt{(x'(t)\,\dt)^2 + (y'(t)\,\dt)^2}\\
  &= \sqrt{(x'(t)^2 + y'(t)^2) \,\dt^2}\\
  &= \sqrt{x'(t)^2 + y'(t)^2} \;|\dt|.
\end{align*}
and we know how to evaluate integrals of forms such as $f(t)\,|\dt|$: we use \cref{eq:onevar-absint}.
In fact, since we nearly always parametrize curves over intervals $[a,b]$ with $a<b$, the arc length integral of a function $f$ generally becomes simply
\[ \itint t a b {f(x(t),y(t)) \sqrt{x'(t)^2 + y'(t)^2}} \]
in two dimensions, or
\[ \itint t a b {f(x(t),y(t),z(t)) \sqrt{x'(t)^2 + y'(t)^2+z'(t)^2}} \]
in three.
In particular, the arc length of the curve $\curve$ in two dimensions is
\[ \itint t a b {\sqrt{x'(t)^2 + y'(t)^2}}, \]
a formula which you may have seen in one-variable calculus.
\begin{stewart}(The textbook discusses it at the end of section 6.4.)\end{stewart}
\begin{hugheshallett}(The textbook discusses it at the end of section 8.2.)\end{hugheshallett}

%% TODO: Add an example.  Note that this integral measures the distance traveled by the particle, not the actual length of its image curve (e.g. if it reverses direction).

\begin{rmk}
  The presence of $|\dt|$ rather than $\dt$ does imply that arc length integrals are independent not only of parametrization, but of the orientation of the curve $\curve$ (see \cref{rmk:lineint-orientation}).
  This makes sense: the length of a curve should not depend on the direction in which we traverse it.
\end{rmk}

\begin{rmk}
  We have defined $\dl$ only in two and three dimensions, but there is an analogous definition in any number of dimensions.
  In \emph{one} dimension, the definition would be
  \[ \dl = \sqrt{\dx^2} = |\dx|. \]
  Thus, the integrals considered in \cref{eg:onevar-absint} are a one-variable version of ``line integrals with respect to arc length''.
\end{rmk}

\begin{notextbook}Your textbook probably discusses arc length integrals and line integrals of vector fields.\end{notextbook}%
\begin{stewart}The textbook discusses line integrals in section 11.5, starting with arc length integrals and then considering also line integrals of linear differential forms (but not by that name) and of vector fields.\end{stewart}%
\begin{hugheshallett}The textbook discusses line integrals in sections 18.1 and 18.2, starting with vector fields and then mentioning linear differential forms (but not by that name) as an alternative notation.
(It does not discuss integrals with respect to arc length, other than the arc length of a curve itself in section 17.2.)\end{hugheshallett}%
\begin{rogawski}The textbook discusses line integrals in section 16.2, starting with arc length integrals (``scalar line integrals'') and then line intgerals of vector fields (``vector line integrals'').\end{rogawski}
Our terminology of differential forms enables us to see all of these as particular cases of the same notion of integral.

\section{The fundamental theorem of calculus}
\label{sec:lineintegral-ftc}
