# Line Integral

**Line integrals** (also referred to as **path** or **curvilinear** integrals) extend the concept of simple integrals (used to find areas of flat, two-dimensional surfaces) to integrals that can be used to find areas of surfaces that "curve out" into three dimensions, as a curtain does. Note that related to **line integrals** is the concept of contour integration; however, contour integration typically applies to integration in the complex plane.

**Line integrals** have a variety of applications. For example, in electromagnetics, they can be used to calculate the work done on a charged particle traveling along some curve in a force field represented by a vector field. Or, in classical mechanics, they can be used to calculate the work done on a mass \(m\) moving in a gravitational field. Both of these problems can be solved via a generalized vector equation.

Or, for example, a **line integral** could determine how much radiation a pirate would be exposed to from a radiation source near the path to his treasure.

Note that at different points along his path he will be exposed to different amounts of radiation depending on how close he is to the source. Integrating the radiation at every point via a **line integral** will help determine the total radiation the pirate is exposed to.

Or one might want to figure out how many calories a swimmer might burn in swimming along a certain route, where the currents in all areas can be accurately predicted.

This also would require the use of a **line integral** because the total work he needs to do will vary depending on the strength and direction of the current. So, a **line integral** over the path shown above will help determine the total work (or calories) that a swimmer will burn in swimming along the path.

#### Contents

## Line Integrals - Fundamental Concepts

For a simple integral, the area is calculated under a curve defined by \(y = f(x):\)

To evaluate the area under the curve, one simply integrates \(f(x)\) from \(a\) to \(b:\)

\[\text{Area} = \int_{a}^{b}f(x)\, dx.\]

However, for **line integrals**, the area is a two-dimensional surface that "curves into three dimensions." It is wavy like a curtain rather than being completely flat like the example above:

This is done by introducing the following set of parametric equations to define the curve \(C\) in the \(xy\)-plane:

\[x=x(t), \quad y=y(t).\]

The area is then found for \(f(x,y)\) by solving the **line integral** (as derived in detail in the next section):

\[\text{Area} = \int_{t=a}^{t=b}f\big(x(t),y(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\]

Generalized to three dimensions, this becomes

\[\text{Area} = \int_{t=a}^{t=b}f\big(x(t),y(t),z(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 + \left(\frac{dz}{dt}\right)^2}\, dt.\]

A line integral is a definite integral where you integrate some function \(f(x,y,z)\) along some path. For which of the following would it be appropriate to use a line integral?

**A.** The total work done on a charge moving in a circle of radius \(R\) on the \(xy\)-plane centered at the \(z\)-axis by a charge at the coordinate \((R,R,R)\)

**B.** The area under the curve \(y=x^2\) between \(x=2\) and \(x=5\)

**C.** The total radiation absorbed by a person walking at a uniform rate around an ellipse with minor axis of length \(a\) and major axis of length \(b\), with a radiation source at the coordinate \((b,a)\)

## Derivation of the Line Integral Equation

The area of a line integral for a curve in the \(xy\)-plane is given above by the equation

\[\text{Area} = \int_{t=a}^{t=b}f\big(x(t),y(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\]

The derivation of this equations is as follows:

First, there is a curve \(C\) in the \(xy\)-plane, defined by a set of parameterized equations \(x(t)\) and \(y(t)\) terminating at the points \(t=a\) and \(t=b:\)

Then curve \(C\) is extended into three dimensions by a function \(z = f(x,y),\) defining a "curtain" between \(f(x,y)\) and \(z=0\) and lying on the curve \(C:\)

Now, the integral is defined similarly to that of a flat integral \(\big(y = f(x)\big).\) Define the width of each small vertical segment of the surface pictured above to be \(\Delta S\). The area of each of these segments is

\[\text{Area} = f(x,y)\Delta S,\]

where \(\Delta S\) is the width of each of those line segments as it approaches zero: \(\Delta S \rightarrow 0.\)

\(\Delta S\) is then expressed in terms of \(\Delta x\) and \(\Delta y:\)

From the Pythagorean theorem, it follows that

\[(\Delta S)^2 = (\Delta x)^2 + (\Delta y)^2.\]

The integral equation follows from this:

\[\text{Area} = \int_{t=a}^{t=b}f(x,y)\, dS.\]

Letting \(\Delta S \rightarrow ds \rightarrow 0\) transforms the above equation to

\[\begin{align} (dS)^2 &= (dx)^2 + (dy)^2\\ dS &= \sqrt{(dx)^2 + (dy)^2}. \end{align}\]

Then the integral becomes

\[\text{Area} = \int_{t=a}^{t=b}f(x,y)\sqrt{(dx)^2 + (dy)^2}.\]

\(x\) and \(y\) are parameterized functions of \(t\):

\[\begin{align} x &= x(t)\\ y &= y(t). \end{align}\]

Also, \(dt\) can be included in the \(\sqrt{(dx)^2 + (dy)^2}\) equation:

\[\sqrt{(dx)^2 + (dy)^2} = \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\]

Then this is substituted into the area equation:

\[\text{Area} = \int_{t=a}^{t=b}f\big(x(t),y(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\]

How is the above result generalized to a path that exists not only in the \(xy\)-plane but also varies in the \(z\)-direction. For example, a roller coaster or an equation that varies with \(z?\)

The main differences are that \(f(x,y)\) is now a function of \(z\) as well, so it's \(f(x,y,z)\), and that \(\Delta S\) defined above now needs to be generalized to three dimensions.

Referring to the picture above, \(\Delta S = \sqrt{\Delta x^2 + \Delta y^2 + \Delta z^2}.\)

So, as \(\Delta S \rightarrow 0\),

\[\begin{align} dS &= \sqrt{dx^2 + dy^2 + dz^2}\\ \frac{dS}{dt} &= \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 + \left(\frac{dz}{dt}\right)^2}. \end{align}\]

So, for the final integral, it follows that

\[\text{Area} = \int_{C}f\big(x(t),y(t),z(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2+ \left(\frac{dz}{dt}\right)^2}\, dt.\ _\square\]

## Solving Line Integrals, A Step-by-Step Approach

**Step 1:** Identify \(f(x,y,z)\) in the above equation and the curve \(C\) over which the integration will take place. For problems involving doing work on an object, \(f(x,y,z)\) represents the force on the particle/object. For example, for a point charge at the origin, \(f(r) = \frac{q}{r^2}\), where \(q\) is the magnitude of the charge and \(r\) is the distance from the charge to the path. Or, in terms of \(x, y,\) and \(z\) for a point charge at the origin, \(f(x,y,z) = \frac{q}{x^2+y^2+z^2}.\) The curve \(C,\) which defines the path that the particle takes, also needs to be determined.

**Step 2:** Determine the parametric equations \(x(t), y(t), z(t).\)

This can be one of the less trivial parts about solving the line integral, since the equation as a function of \(x, y, z\) needs to be translated to \(x(t), y(t), z(t).\) For example, the equation \(x^2 + y^2 = R^2\) translates to a circle, which has the parametric equation \(x(t) = R\cos(t)\) and \(y(t) = R\sin(t)\), where \(t: 0 \rightarrow 2\pi.\)

The following table shows some of the more common parametric equations:

\[ \begin{align} {\color{Blue} \textbf{Coordinate Equation}} &&&&&{\color{Blue} \textbf{Parametric Equation}} \\ x^2 + y^2 = R^2 &&&&& x(t) = R\cos(t), y(t) = R\sin(t) \\ (x-x_0)^2 + (y-y_0)^2 = R^2 &&&&& x(t) = x_0 + R\cos(t), y(t) = y_0 + R\sin(t) \\ y = mx + b &&&&& x(t) = -\frac{b}{m} + \frac{t}{\sqrt{m^2 + 1}}, y = b + \frac{mt}{\sqrt{m^2+1}} \\ \text{Helix centered on }z\text{-axis, radius }R,\text{ spacing }a &&&&& x(t) = R\cos(t), y(t) = R\sin(t), z(t) = \frac{at}{2\pi}. \end{align} \]

**Step 3:** Calculate \(ds:\)
\[ds = \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 + \left(\frac{dz}{dt}\right)^2}.\]

**Step 4:** Solve the integral:
\[\text{Area} = \int_{C}f\big(x(t),y(t),z(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2+ \left(\frac{dz}{dt}\right)^2}\, dt.\]

Solve the line integral for \(f(x,y) = xy\) along the contour defined by the circle \(x^2 + y^2 = 9\) in the direction of the line shown:

Step 1:In this case, it is clear that \(f(x,y) = xy\) and the path \(C\) is along the circle \(x^2 + y^2 = 9\).

Step 2:We need to translate the equation \(x^2 + y^2 = 9\) into a pair of parametric equations \(x(t)\) and \(y(t)\).

For a circle of radius \(3\), the following parametric equations fit the bill: \[x(t) = 3\sin(t),\quad y(t) = 3\cos(t),\] and in this case \(0 \leq t \leq \pi\) in order to follow the red curve above.Now we use the general equation above: \[\text{Area} = \int_{t=a}^{t=b}f\big(x(t),y(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\] Substituting in gives \[\text{Area} = \int_{t=0}^{t=\pi}f\big(3\sin(t),3\cos(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt.\]

Step 3:We have

- \(x(t) = 3\sin(t) \implies \frac{dx}{dt} = 3\cos(t)\)
- \(y(t) = 3\cos(t) \implies \frac{dy}{dt} = -3\sin(t),\)
and since \(f(x,y) = xy,\) \(f\big(3\sin(t),3\cos(t)\big) = 9\cos(t)\sin(t).\)

Step 4:So, the area becomes \[\begin{align} \text{Area} &= 9\int_{t=0}^{t=\pi}\cos(t)\sin(t)\sqrt{\big(-\sin(t)\big)^2 + \big(\cos(t)\big)^2}\, dt\\ &= 9\int_{t=0}^{t=\pi}\cos(t)\sin(t)\, dt \\ &= \boxed{0}. \end{align}\] This is what we would have expected due to the symmetry of the problem. \(_\square\)

A parametric equation is a way of representing a relationship between two variables (say, \(x\) and \(y\)) by introducing a third variable, say \(t\), and setting up a set of equations as a function of this third variable.

Suppose we have the following equation of an ellipse:

\[x^2 + 4y^2 = R^2.\]

Which set of parametric equations will trace out a similar ellipse?

**A.** \(x(t) = R\cos(t), y(t) = \frac{R\sin(t)}{2}\)

**B.** \(x(t) = R\sin(t), y(t) = \frac{R\cos(t)}{2}\)

**C.** \(x(t) = R\cos(t), y(t) = 2R\sin(t)\)

**D.** \(x(t) = 2R\cos(t), y(t) = R\sin(t)\)

## The Bank Robber

Now for a tangible problem to investigate:

Suppose there is a bank robber who wants to find a key and then use it to open a safe.

The trick is, when he gets the key, he triggers an alarm that sets off a radiation bomb that emits radiation at a constant rate until he opens the safe, at which point no more radiation is emitted.

He now would like to optimize his route so that he gets the lowest dosage of radiation possible.

Assume that the key is at \((0,1)\). The safe is at \((1,0)\), and the intensity of the radiation is released at a rate of

\[I = \frac{1}{r^2}.\]

So, for example, if the robber stands a distance of \(R\) away for a time period of \(t = T\), the total amount of radiation he receives is

\[(\text{Total radiation}) = \frac{T}{R^2}.\]

So now for the question... Which of the following paths would allow the robber to grab the key and open the safe with the least possible radiation exposure? (Assume that whichever path he takes, he will move at a constant rate.)

Let's consider these three options:

**A.** Arc of a circle centered at \((1,1)\)

**B.** Direct route from \((0,1)\) to \((1,0)\)

**C.** Arc of a circle centered at \((0,0)\).

Clearly, the question the robber faces is how to spend the least amount of time exposed to the radiation but also to stay sufficiently far from the radiation source.

Intuitively, **A** is out, since it is not only a longer route than **B** but it also takes him closer to the radiation. Ouch!

However, **B** and **C** are not as obvious. **B** being the most direct route (a straight line), it gives him the least amount of total time exposed to the radiation but gets him slightly closer to the radiation than **C**. Alternatively, **C** keeps him further from the radiation, but it gives him a bit more total time exposed to the radiation.

So, which path is better?

This is where taking a line integral of each path comes in handy.

So, let's start with **C**. Although the line integral could be taken here, it wouldn't be very interesting since although he is moving in an arc, he stays the same distance from the radiation source at the origin, so the total radiation exposure \(E\) will be

\[E_C = \frac{T}{R^2} = \frac{T}{1^2} = T,\]

where \(T\) is the total time he takes to get there. Since WLOG his velocity can be taken to be 1, this is just the length of the arc, or \(\frac{\pi}{2}:\)

\[E_C = \frac{\pi}{2}.\]

Now for path B...

For this, a **line integral** will be necessary because the robber is at different distances from the radiation and therefore is getting different amounts of radiation at different points along his path.

Clearly, at the point \(\big(\frac{1}{2},\frac{1}{2}\big)\) the radiation will be at its maximum, and at \((0,1)\) and \((1,0)\) the radiation exposure will be at a minumum (for this particular path). So, qualitatively, the radiation along the path will look like this:

The total radiation exposure along path **B**, \(E_B\), represented by the area under the curve (the blue area), is what a line integral will be able to evaluate:

\[E_B = \int_{B}^{}I\, dS = \int_{a}^{b}I\,dS,\]

where

- \(a = \text{position of the key}\)
- \(b = \text{position of the safe}\)
- \(I = \text{radiation intensity} = \frac{1}{r^2}\)
- \(dS = \text{the widths of the little segments}\).

For the line integral, the first step is to set up the parametric equations, \(x(t)\) and \(y(t)\).

\(x(t)\) goes from \(0\) to \(1\), and \(y(t)\) goes from \(1\) to \(0\), at the rate of \(\frac{1}{\sqrt2}\) due to the \(45^\circ\) angle of the path.

This gives

\[x(t) = \frac{t}{\sqrt{2}},\quad y(t) = 1 - \frac{t}{\sqrt{2}}.\]

So,

\[\frac{dx}{dt} = \frac{1}{\sqrt{2}},\quad \frac{dy}{dt} = - \frac{1}{\sqrt{2}}.\]

Finally, a **line integral** can be used to find the radiation exposure along path **B**, \(E_B:\)

\[\begin{align} E_B &= \int_{B}^{}I\, dS\\ &= \int_{t=0}^{t=\sqrt{2}}I\big(x(t),y(t)\big)\sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt\\ &= \int_{t=0}^{t=\sqrt{2}}\left(\frac{1}{r^2}\right)\sqrt{\left(\frac{1}{\sqrt{2}}\right)^2 + \left(-\frac{1}{\sqrt{2}}\right)^2}\, dt\\ &= \int_{t=0}^{t=\sqrt{2}}\left(\frac{1}{x^2 + y^2}\right)\sqrt{\frac{1}{2} + \frac{1}{2}}\, dt\\ &= \int_{t=0}^{t=\sqrt{2}}\frac{1}{\left(\frac{t}{\sqrt{2}}\right)^2 + \left(1 - \frac{t}{\sqrt{2}}\right)^2}\, dt\\ &= \int_0^{\sqrt{2}}\frac{1}{\frac{t^2}{2} + \left(1 - 2\frac{t}{\sqrt{2}} + \frac{t^2}{2}\right)}\, dt\\ &= \int_0^{\sqrt{2}}\frac{dt}{t^2 - \sqrt{2}t + 1}. \end{align}\]

If \(u = t-\frac{1}{\sqrt2},\) then \(u^2 = t^2 - \sqrt2t + \frac{1}{2},\) which implies

\[\begin{align} E_B &= \int_{-\frac{1}{\sqrt2}}^\frac{1}{\sqrt{2}}\frac{du}{u^2 + \frac{1}{2}}\\ &= \sqrt2\arctan \big(\sqrt2u\big) \Big|_{-\frac{1}{\sqrt{2}}}^{\frac{1}{\sqrt{2}}}\\ &= \sqrt2\big(\arctan (1) - \arctan(-1)\big)\\ &= \frac{\sqrt2\pi}{2}. \end{align}\]

Therefore, \(E_B > E_C\). His best choice is \(\boxed{\text{Path C}}\).