Line integrals, continued

Example: polar force field

Let's do another example. Suppose we have a force which is proportional to the polar unit vector \( \hat{\phi} \),

\[ \begin{aligned} \vec{F} = F\hat{\phi} \end{aligned} \]

and we're interested in the work done along a counterclockwise half-circle path from \( (1,0) \) to \( (-1,0) \).

Sketching vector fields makes my hand hurt, so here's another Mathematica plot:

(I converted from polar to Cartesian for the plot - more on that below.) Think about it - does this match what you expected the plot to look like?

Next, we need \( d\vec{r} \) so we can find the dot product. Since we have \( \vec{F} \) in polar coordinates, we should use \( d\vec{r} \) in the same coordinates. We'll assume \( z=0 \), but in full 3-d cylindrical coordinates, we know that

\[ \begin{aligned} \vec{r} = \rho \hat{\rho} + z \hat{z} \end{aligned} \]

To find \( d\vec{r} \), one way would just be to start with the Cartesian version

\[ \begin{aligned} d\vec{r} = dx\ \hat{x} + dy\ \hat{y} + dz\ \hat{z} \end{aligned} \]

and apply our coordinate change. More directly, we can just calculate the derivative of \( \vec{r} \) with respect to some parameter, like \( t \), and then cancel off the \( dt \)'s. Let's try it that way:

\[ \begin{aligned} \frac{d\vec{r}}{dt} = \dot{\rho} \hat{\rho} + \rho \frac{d\hat{\rho}}{dt} + \dot{z} \hat{z} \\ = \frac{d\rho}{dt} \hat{\rho} + \rho \frac{d\phi}{dt} \hat{\phi} + \frac{dz}{dt} \hat{z} \end{aligned} \]

using the result for \( d\hat{\rho}/dt \) that we worked out back at the start of the semester. Cancelling off the \( dt \)'s,

\[ \begin{aligned} d\vec{r} = d\rho\ \hat{\rho} + \rho d\phi\ \hat{\phi} + dz\ \hat{z}. \end{aligned} \]

In case you ever need it, I'll save you some trouble and give you the result for spherical coordinates:

\[ \begin{aligned} d\vec{r} = dr\ \hat{r} + r d\theta\ \hat{\theta} + r\sin \theta d\phi\ \hat{\phi}. \end{aligned} \]

Using our result, we have the simple result

\[ \begin{aligned} dW = \vec{F} \cdot d\vec{r} = F \rho d\phi \end{aligned} \]

Next, we parameterize the half-circular path. Any time we have a path like a circle or a spiral, an angle is a natural parameter to use. In fact, since this is just a section of the unit circle, we can easily write the path in the trivial-looking form

\[ \begin{aligned} \rho = 1, \\ \phi = \phi, \end{aligned} \]

starting at \( \phi=0 \) and ending at \( \phi=\pi \). Thus, the integral can be written simply as

\[ \begin{aligned} W = \int_0^\pi F d\phi = \pi F. \end{aligned} \]

(Don't be confused by units! Remember, our path has units of distance, so this is something like "pi meters times the constant force \( F \).")

Note that the length of the path can also be found by a line integral, which amounts to adding up a bunch of infinitesmal length segments:

\[ \begin{aligned} \ell = \int |d\vec{r}| = \int \sqrt{d\vec{r} \cdot d\vec{r}} = \int \sqrt{\rho^2 d\phi^2} = \int_0^\pi \rho\ d\phi = \pi \end{aligned} \]

(this is also easy to find geometrically as just half the circumference of a circle, of course.) So in this case, just like in our one-dimensional examples, we have simply \( W = F \ell \). This happens because for this particular path and force, \( \vec{F} \) and \( d\vec{r} \) point in the same direction as one another along the entire path.

By the way, in this problem it was sort of obvious to choose polar coordinates, because of how we were given the force. But we could have been given \( \vec{F} \) in Cartesian coordinates instead:

\[ \begin{aligned} \vec{F} = -\frac{y}{\sqrt{x^2 + y^2}} \hat{x} + \frac{x}{\sqrt{x^2 + y^2}} \hat{y} \end{aligned} \]

You might be able to spot the fact that this is just \( \hat{\phi} \) from the expression, but a more reliable way to see that polar coordinates might be the way to go would be to plot the force field (this is one reason plotting vector fields is useful!)

Another important note on coordinate dependence: it's generally a better idea to let the force field dictate the coordinate choice, rather than the path. For example, suppose we had this same circular force, but the straight-line path \( y = x/2 \) from our previous example. It's actually not so hard to parametrize that path in polar coordinates: remembering how polar and Cartesian are related, the line equation above becomes

\[ \begin{aligned} \rho \sin \phi = \frac{1}{2} \rho \cos \phi \Rightarrow \tan \phi = \frac{1}{2}. \end{aligned} \]

So this is a path with constant \( \phi \) and constant \( z \), giving \( d\vec{r} = d\rho \hat{\rho} \). We don't have to go any further, since \( \vec{F} \cdot d\vec{r} = 0 \) and the work is just zero. (It will still be zero in Cartesian coordinates, but the integral will be much more work!)

That was too easy, since a straight line through the origin is just in the \( \hat{\rho} \) direction and therefore still nice in cylindrical coordinates. What about this path, the fixed vertical line \( x=1 \) from \( (1,1) \) to \( (1,-1) \)?


Clicker Question

What is the correct equation for the pictured path in polar coordinates?

A. \( \rho = \sqrt{2} \sqrt{1 - (\phi - \pi/4)^2} \)

B. \( \rho = \sqrt{2} \sqrt{1 + (\phi - \pi/4)^2} \)

C. \( \rho = \cos \phi \)

D. \( \rho = \frac{1}{\cos \phi} \)

E. It's not possible to write this path in polar coordinates.

Answer: D

We can still write this in polar coordinates! In fact, since \( x = \rho \cos \phi \), the equation for this line is

\[ \begin{aligned} x = 1 \Rightarrow \rho(\phi) = \frac{1}{\cos \phi} \end{aligned} \]

That's all there is to it! Once we've disposed of the vector components, changing between coordinate systems is easy - just plugging in and reorganizing.


Using this formulation, the work integral still takes the same form we found above,

\[ \begin{aligned} W = \int \vec{F} \cdot d\vec{r} = \int F \rho d\phi \\ = F \int_{\pi/4}^{-\pi/4} \frac{d\phi}{\cos \phi} \\ \approx (-1.76\ {\rm m}) F \end{aligned} \]

where I used Mathematica to do the integral numerically - it ends up being a complicated combination of logs and trig functions. I'm just reading the \( \phi \) limits of integration off the plot geometrically, but in general we get them by solving the equation of our line at the given points.

This method will work for even more complicated paths. Here's a more interesting line, \( y = 1 + x/2 \) from \( (0,1) \) to \( (2,2) \):

Now if we substitute in the conversion for both \( x \) and \( y \), the equation for the line becomes

\[ \begin{aligned} \rho \sin \phi = 1 + \frac{1}{2} \rho \cos \phi \\ \rho (2\sin \phi - \cos \phi) = 2 \\ \rho(\phi) = \frac{2}{2\sin \phi - \cos \phi}. \end{aligned} \]

This will be a slightly messier integral over \( \phi \) (feel free to try it for practice!), but there's no change to \( \vec{F} \cdot d\vec{r} \). The moral of these examples is that the force is the most important factor in your choice of coordinate system for a line integral, because we have to deal with the vector components of the force. Once that's out of the way, it's easy to make our path conform to whatever coordinates we've chosen.


To recap, when faced with a line integral, we need to work through the following steps to find the answer:

  1. Choose vector coordinates and find \( \vec{F} \cdot d\vec{r} \). (The form of \( \vec{F} \) is usually most important in coordinate choice, but don't ignore the path completely.)
  2. Parameterize the path, writing it in terms of a single coordinate or parameter.
  3. Use the results of 1) and 2) to write the work integral as a regular integral over our single parameter.
  4. Do the integral and find the answer!

Example: another line integral

Calculate the work integral \( W = \vec{F} \cdot d\vec{r} \) for the force \( \vec{F} = 2\vec{r} \) and parabolic path \( x = 1-y^2 \), from \( (1,0) \) to \( (0,1) \).

Let's start by sketching the path:

It might be tempting to choose polar coordinates since the force field is radial, but radial force is pretty easy to describe in Cartesian coordinates too, and our path will be easier in Cartesian. (If we had a force in the \( \hat{\phi} \) direction, we'd almost certainly want polar instead!) Using Cartesian, we have

\[ \begin{aligned} \vec{F} = 2x \hat{x} + 2y \hat{y} \end{aligned} \]

and so

\[ \begin{aligned} \vec{F} \cdot d\vec{r} = 2Fx dx + 2Fy dy. \end{aligned} \]

Next, we parameterize the path. Here \( y \) itself is a nice parameter, since we already have the path written in the form \( x = 1-y^2 \). In terms of differentials, we have

\[ \begin{aligned} dx = -2y dy \end{aligned} \]

and in terms of \( y \), our path begins at \( y=1 \) and ends at \( y=0 \). So writing out our line integral,

\[ \begin{aligned} W = \int \vec{F} \cdot d\vec{r} = \int (2Fx dx + 2Fy dy) \\ = 2F \int_1^0 (1-y^2) (-2y dy) + y dy \\ = 2F \int_1^0 dy\ (-y + 2y^3) \\ = 2F \left. \left(-\frac{y^2}{2} + \frac{y^4}{2} \right) \right|_0^1 \\ = 0. \end{aligned} \]

Although the work is exactly zero here, it's sort of a coincidence: we notice that the cancellation of \( y^2 \) and \( y^4 \) only worked at \( y=0 \) and \( y=1 \), so pretty much any other starting or ending points along this curve would yield non-zero work.


Potential energy

Now that we know how to calculate line integrals, let's go back to the physical meaning of work. In mechanics, we aren't going to be dealing with completely arbitrary paths; the work-KE theorem only applies to the path which results from Newton's laws and whatever forces are applied.

At the beginning of this section, I mentioned that energy comes in many forms. To really see how work and energy can be useful, we need to introduce a second form of energy, which is called potential energy. You may remember the buzzwords from intro physics: a potential energy can only be defined for a conservative force. This turns out to be a consequence of how we define a conservative force, acting on a point mass:

  1. Conservative forces depend only on \( \vec{r} \) and constants.
  2. The work done by a conservative force from \( \vec{r}_1 \) to \( \vec{r}_2 \) is independent of the path taken.

When both of these properties are satisfied, if we're given two points anywhere in space, we immediately know the work done by the conservative force when we move from one to the other. (Property 1 matters because we don't need any extra info to decide the work done, like how long it took to move between the points or how fast the object was moving.)

Now let's pick a special point \( \vec{r}_0 \) somewhere in space and hold it fixed. The work done to get to any other point \( \vec{r} \) from this special point is a function only of where the second point is:

\[ \begin{aligned} W_{\vec{r}_0 \rightarrow \vec{r}} = \int_{\vec{r}_0}^{\vec{r}} \vec{F} \cdot d\vec{r} = -U(\vec{r}) \end{aligned} \]

This defines the potential energy function. (It only depends on \( \vec{r} \), because we've agreed to hold \( \vec{r}_0 \) fixed.) The minus sign I added at the end is extremely important, as we'll see below! Basically, it has to do with energy conservation: positive work will give a positive change in kinetic energy, which will be compensated by a negative change in potential energy so the total stays fixed.

Now, let's do a short mathematical proof that will let us make two nice observations. If we try to calculate \( U(\vec{r}_0) \), we find the following:

\[ \begin{aligned} U(\vec{r}_0) = -\int_{\vec{r}_0}^{\vec{r}_0} \vec{F} \cdot d\vec{r} \\ = -\int_{\vec{r}_0}^{\vec{r}_1} \vec{F} \cdot d\vec{r} - \int_{\vec{r}_1}^{\vec{r}_0} \vec{F} \cdot d\vec{r} \end{aligned} \]

where I'm now just picking another arbitrary point \( \vec{r}_1 \) and using the properties of definite integration to split it up. Okay, this isn't a normal integral. Really, the original line integral represents a closed path from \( \vec{r}_0 \) back to itself, and I've picked a point somewhere along that path and divided it in half:

Reversing the limits of any integral, including a line integral, just gives us a minus sign:

\[ \begin{aligned} U(\vec{r}_0) = -\int_{\vec{r}_0}^{\vec{r}_1} \vec{F} \cdot d\vec{r} + \int_{\vec{r}_0}^{\vec{r}_1} \vec{F} \cdot d\vec{r} = 0. \end{aligned} \]

These two integrals are on two different curves, but since \( \vec{F} \) is conservative it doesn't matter; their results are equal and they cancel. The first nice observation is that picking a reference point is the same thing as choosing where our potential energy function is equal to zero, which you'll remember as something you can do with e.g. the gravitational potential.

If you choose a different reference point \( \vec{r}'_0 \), then your potential energy function will be different, but in a simple way:

\[ \begin{aligned} U'(\vec{r}) = -\int_{\vec{r}'_0}^{\vec{r}} dW = -\int_{\vec{r}'_0}^{\vec{r}_0} dW - \int_{\vec{r}_0}^{\vec{r}} dW \\ = U(\vec{r}_0') - U(\vec{r}) \end{aligned} \]

or in other words, the difference between \( U \) and \( U' \) is just a shift by a constant.

The second nice observation we can make is that we've just showed that for any force which satisfies property 2 above (work done is path-independent), the work done around a closed path is exactly zero. You may remember the special notation for closed-path integrals from vector calculus:

\[ \begin{aligned} \oint \vec{F} \cdot d\vec{r} = 0. \end{aligned} \]

If you remember that notation, you probably also remember that \( \vec{F} \cdot d\vec{r} \) shows up in a very powerful result called Stokes' theorem. We'll come back to that later on: it will give us a much clearer picture of why any particular force should obey property 2 above, which seems sort of arbitrary right now.