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. To make sure I'm cutting to the chase, I will start with showing you the computational definition of a line integral and quickly show you a "fundamental theorem" that lets you shortcut this computation. What is far more interesting is how all of this works, so most of this content will be dedicated to motivating the intuition and background behind the computations.

Line Integral Formula:
For a curve $\vec{c}(t)$ with starting point $t=a$ and ending point $t=b$ through a vector field $\vec{F}(x,y)$, it is $$ \int_a^b \vec{F}(\vec{c}(t)) \cdot \vec{c}'(t) \ dt. $$

Example Computation:
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 $$


Fundamental Theorem:
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)). $$

Example Computation:
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 $$


That's it! But it's kind of hollow without any understanding or motivation, isn't it? If you thought "yes!", then I made the rest of this material for you!

Road Map:
To properly motivate everything you saw above, we will...

  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.






3) Path Integrals

Path integrals find (signed) area under a curve as well. But the curve is more interesting! We take a curve $\vec{c}(t)$ in the plane and a surface $z = f(x,y)$ and compute the signed area under the curve lifted to the surface. So at time $t$, the position of the curve $\langle x(t), y(t), 0 \rangle$ is lifted 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 doint 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) \\\|$. This is a lot like integration by substition, where you trade out $dx$ for $\frac{dx}{dt} dt$. Here is the 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 upwards 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.





Conclusion

Here are some concluding remarks to tie everything together.





Concept Check

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