Line Integrals

Line integrals have a straight-forward definition and are not difficult to compute as long as the integral can be done and the curve can be parameterized. In fact, we'll start by just computing one to show you that it's barely more than an integral of a dot product. You'll also see a shortcut formula next. Both are here at the top for quick reference. With the formulas done, we'll see what's happening geometrically and see a shortcut this computation.


Line Integral Formula

For a parameteric curve $\vec{c}(t)$ with starting point $t=a$ and ending point $t=b$ through a vector field $\vec{F}(x,y)$, the line integral over the interval $[a,b]$ is $$ \int_a^b \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt. $$


Line Integral Example

Here is an example computation. For the curve $\vec{c}(t) = \langle \cos(t), \sin(t) \rangle$ from $t=0$ to $t=2\pi$ through the vector field $\vec{F}(x,y) = \left\langle -y, x \right\rangle$ is computed as...

$$ \int_a^b \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt = \int_a^b \langle -y, x \rangle \cdot \langle -\sin(t), \cos(t) \rangle \ dt $$ $$ = \int_{0}^{2\pi} \left\langle -\sin(t), \cos(t) \right\rangle \cdot \left\langle -\sin(t), \cos(t) \right\rangle \ dt $$ $$ = \int_{0}^{2\pi} \sin(t)^2 + \cos(t)^2 \ dt $$ $$ = \int_{0}^{2\pi} 1 \ dt $$ $$ = 2 \pi $$



Shortcut

In the case where the vector field $\vec{F}(x,y)$ happens to be the gradient of another function $f(x,y)$, a line integral can be computed instead by subtracting $f$ evaluated at the start point from $f$ evauated at the end point of the curve. That is, when $\vec{F}(x,y) = \nabla f(x,y)$, $$ \int_a^b \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt = f(c(b)) - f(c(a)). $$


Shortcut Example

Let $\vec{c}(t) = \langle \cos(t), \sin(t) \rangle$ be the same curve, but this time from $t=0$ to $t=\frac{\pi}{2}$. Compute the line integral through the vector field $\vec{F}(x,y) = \left\langle 2x, -2y \right\rangle$. Because $\langle x, y \rangle$ is the gradient of the function $f(x,y) = x^2 - y^2$, we can use this theorem. This might even remind you a lot of seeing FTC with an anti-derivative. Using the fundamental theorem,

$$ \int_{0}^{\frac{\pi}{2}} \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt = f\left( \vec{c} \left( \frac{\pi}{2} \right) \right) - f(\vec{c}(0))$$ $$ = f(1,0) - f(0,1) $$ $$ 1^2 - (-1^2) $$ $$ = 0 $$


Those are the formulas and computation. Not difficult? Is it clear why they work? What do they have to do with the material you've been learning? With the computational bases covered, we're free to explore how these line integrals work.


Understanding Line Integrals

  1. Integral Refresher
  2. Examine integrals with parameterizations.
  3. Give a visual example of a path integral (a line integral's first cousin).
  4. Give an example of a line integral.
  5. Refresh what gradients and contour diagrams are.
  6. Connect everything with the Fundamental Theorem.




1) Integral Refersher

Integrals are the limit of their Riemann sums as the number of subdivisions approaches $\infty$. Consider the example below. A sample is taken from each interval and used to estimate the height of the function for that whole interval. Samples can be taken from anywhere in the interval. The area of each rectangle is the movement in the $x$-direction times the hight estimation for that rectangle.

$$ \text{Rectangle Area} = \Delta x \cdot f(x_i) $$

$$ \int_a^b f(x) \ dx \approx \sum_{i=1}^n \Delta x \cdot f(x_i) $$

In this figure, we are getting estimations of the area under the curve that are around 10. The more boxes you have, the more accurate your sum has to be.





2) Parameterizing Regular Integrals

We are integrating over parameterized surfaces, so we'll parameterize $x$.

$$ x(t) = 5t $$

To parameterize the $x$ values we need, $t$ must range from $-2$ to $2$. Let's look at those Riemann Sums.


Example 2: Parameterized Riemann Sum

We are getting estimations of the area under the curve that are around 2.

...2??



What happened?

The sum rectangles were computed too small because the faster speed ($x'(t)$) than 1 meant we spent less time in each interval. We aren't measuring time taken for the horizontal part of our sums, we're measuring the distance travelled. Our sum was off by a factor of 5 because for each $x$-interval we only spent $\frac{1}{5}$ of the time we should have spent in that interval.

The Solution

Multiplying by the speed fixes this problem. In fact, this is the $\frac{dx}{dt}$ factor you would see in substitution.

To see this, consider both of the Riemann Sum approximations and compare them:

$$ \int_{x(a)}^{x(b)} f(x) \ dx \approx \sum_{i=1}^n \left( \Delta x \right) \cdot f(x(t_i)) = \sum_{i=1}^n \left( \Delta t \frac{\Delta x}{\Delta t} \right) \cdot f(x(t_i)) $$

$$ \int_a^b f(x(t)) \ \cdot x'(t) dx \approx \sum_{i=1}^n \left( \Delta t \cdot x'(t_i) \right) \cdot f(x(t_i)) $$

The right hand sides are exactly equal in our case, since $x'(t)$ is a constant of 5, but in general we can get the average changes $\frac{\Delta x}{\Delta t}$ to approach $x'(t)$ as $n$ approaches infinity.



Connection to Polar/Cylindrical/Spherical Coordinates

The term $\frac{dx}{dt}$ we are multiplying by inside the integral is the 1-dimensional version of the Jacobian.
It's the determinant of the 1x1 matrix of partials: $$ \left| \frac{\partial x}{\partial t} \right| = \frac{dx}{dt}. $$






3) Path Integrals

Path integrals find signed area under a curve as well, but the curve can change direction because the move through a dimension higher than 1. Given any curve $\vec{c}(t)$ in $\mathbb{R}^2$ and any 2-variable function $f(x,y)$, think of the curve in the $xy$-plane as one edge of the area we're finding and the curve lifted to the surface $z=f(x,y)$ as the other edge.
At any time $t$, the position of the lifted curve goes from $\vec{c}(t) = \langle x(t), y(t), 0 \rangle$ to $\langle x(t), y(t), f(x(t), y(t)) \rangle$.

Because path integrals use parameters, we have two ways we can go about doing this.

  1. We can find the arc-length parameterization of $\vec{c}(t)$ and then integrate $f(\vec{c}(t))$ from the starting time to the ending time. (yuck!)
  2. We can integrate a non arc-length parameterized curve but adjust for the fact that we are not moving through space at a unit speed.
For the second version, we just add in the speed factor $\\\| \vec{c}'(t) \\\|$ (that's the Jacobian again).

Path Integral Formula

$$\int_a^b f(\vec{c}(t)) \cdot \\\| \vec{c}'(t) \\\| \ dt$$

In the diagram above, the integral is not parameterized at unit speed. Time is chopped up into $n$ evenly-spaced pieces, but you can see that the widths are not the same. This is because of the speed difference along the curve. Multiplying by the speed factor in your integral adjusts for how much space you have actually travelled through in each time period.





4) Line Integrals

In the previous example, path integrals measured something for a curve passing through a scalar field, which is a function that has a number $z=f(x,y)$ at each point $(x,y)$.

In contrast, line integrals measure something for a curve passing through a vector field instead, which has a vector $\vec{v} = \vec{F}(x,y)$ at each point $(x,y)$.

It would be really nice to show you a similar visual example to the path integrals, where we have a curve lifted to a surface. Unfortunately, we don't quite have such a nice visual intuition for what they represent. But I can describe what they capture.

For a curve moving at unit speed, a line integral is the area under the curve with height given by the parallel part of the vector field to the direction of motion.

It would be nice if there were a more natural way to visualize these. In the meantime, we'll shift gears to reviewing some important ideas about gradients and contour diagrams.





5) Refresher: Gradients and Contour Diagrams

Gradients

Given any surface $z=f(x,y)$, the gradient is the vector field given by $\nabla f(x,y)=\langle f_x(x,y), f_y(x,y) \rangle$. Computationally, this is a vector at each point $(x,y)$ that lists the partial derivatives $\frac{\partial}{\partial x}(f), \frac{\partial}{\partial y}(f)$. But geometrically, these are vectors whose directions point in the steepest direction and whose magnitudes reflect the maximum steepness of the surface in those directions.

Contour Diagrams

Given any surface $z = f(x,y)$, a contour diagram is comprised of 2-D graphs of curves that represent level sets $z = f(x,y) = h$ for evenly-spaced height values given by $h$. It is important to note that since the heights are evenly spaced, closer curves reflect a steeper slope while further curves represent less steep slopes.

Below is a figure with a gradient field (gradient vectors at points) along with level sets that make up a contour diagram. Notice how the contours get more dense when the arrows grow and how the curves are always perpendicular to the gradient arrows.









6) Connecting The Two

As you remember from a few weeks ago, the change in height on the tangent plane is the dot product of your motion vector in the $xy$-plane with the gradient. $$ \langle f_x, f_y \rangle \cdot \langle \Delta x, \Delta y \rangle $$ This also means that when your motion vector on the $xy$-plane is a normal vector like $\vec{u}$, the dot product $\nabla f \cdot \vec{u}$ is the slope in that direction.

Two very important ways of thinking about this are 1) the slope in any direction is the projection of the gradient onto your unit direction vector and 2) if you are traveling on a curve $\vec{c}(t)$ in the $xy$-plane lifted onto a surface $z = f(x,y)$, then your vertical velocity is given by: $$ \frac{dz}{dt} = \nabla f(\vec{c}(t)) \cdot \vec{c}'(t). $$

The vector field in our line integral example happened to be the gradient field of a plane slanting in the negative $x$ direction. Let's take another look at the surface and gradient.





The Shortcut -- The Fundamental Theorem of Line Integrals

In the case where the vector field is a gradient, $\vec{F}(x,y) = \langle f_x(x,y), f_y(x,y) \rangle$, then the dot product we are integrating is $$ \vec{F}(\vec{c}(t)) \cdot \vec{c} \ '(t) = \langle f_x(c(t)), f_y(c(t)) \rangle \cdot \vec{c} \ '(t). $$ From the chain rule you learned shortly after the first midterm, $\langle f_x(c(t)), f_y(c(t)) \rangle \cdot \vec{c} \ '(t) = \frac{dz}{dt}$ is the vertical velocity of a point on curve lifted to the surface.
So integrating $\frac{dz}{dt}$ over $t$ tells us the total change in height on that surface: $$ \int_a^b \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt = \int_a^b \frac{df(\vec{c}(t))}{dt} \ dt = f(\vec{c}(b)) - f(\vec{c}(a)). $$





Question

What if instead of the half-circle we used as our curve for the line integral above, we used a full circle. What would the line integral be over that curve through the same gradient field?




Warning

This shortcut only works when the vector field is a gradient. Most vector fields are not gradients of anything. You will learn how to test for these in Math 6B.
But one easy way to tell, based on the previous question, is if you have a gradient field with a line integral that begins and ends in the same place but isn't 0.