Work is force times distance, if the force is steady and the path is straight. Out in the world neither is true for long. A satellite's path curves, and the pull on it changes all the way round. This lesson handles both at once, with the oldest trick in calculus: cut the path into steps so short that each one is straight and the force on it is steady, then add up. The same trick spread across a surface measures how much of a field passes through it. Those two sums, along a path and across a surface, are what the laws of electricity and magnetism are written in.
- Press "Walk the path". On each short step, only the part of the force along the path counts: the coloured arrow on the walker. Where the force helps, the path turns amber and the total rises. Where it hinders, the path turns blue and the total falls.
- Watch the graph underneath as it fills. It plots that part of the force against the distance walked, so the work is the area under it, with blue area counting as negative.
- Now drag either amber point, to send the route over the hilltop or round behind the hollow. The colours and the graph change completely. The total doesn't: it stays at 2.47 J.
- Drag the white end point onto the hilltop. The total goes negative, because overall the walker has had to climb.
- Tick "Close the path into a loop". The total is 0.00 J, whatever shape you pull the loop into.
- Untick it and choose "A steady push". The total is 2 N times how far east the end is from the start, and again the route makes no difference.
- Choose "A whirlpool". This whirlpool turns like a wheel, pushing harder the further out you are. Drag an amber point: this time the total changes with the route. Close the loop: it isn't zero. Drag the points until the loop runs clockwise, and it turns negative.
Adding up along a path
Cut the path into short steps. Each step is a little arrow, written \(d\mathbf{l}\): it points the way you're going and its length is how far the step takes you. On one step the force \(\mathbf{F}\) is as good as steady, so the work done is the dot product \(\mathbf{F}\cdot d\mathbf{l}\), the part of the force along the step times the step's length. Add up every step. That sum, as the steps shrink, is a line integral:
It's less new than it looks. Write \(F_\parallel\) for the part of the force along the path, and \(s\) for the distance walked. Then each step adds \(F_\parallel\,ds\), and the line integral is the ordinary integral \(\int F_\parallel\,ds\). That's the graph under the figure: the path pulled straight, and an area.
In three cases there's nothing to add up.
- A steady force and a straight path. Every step has the same \(\mathbf{F}\), so the sum is \(\mathbf{F}\) dotted with all the steps laid end to end: \(W = \mathbf{F}\cdot\mathbf{d}\), as in dot and cross products.
- A force that always points along the path. Then \(F_\parallel\) is the whole force, and \(W = \int F\,ds\). That's the \(\int F\,dx\) of work and energy.
- A force that's always square to the path. Every step adds zero. The Sun's pull on a planet in a circular orbit does no work, which is why the planet neither speeds up nor slows down.
For anything else you really do have to add up. Paths made of straight legs along the axes are the easy ones, because on each leg only one coordinate changes. Take the force \(\mathbf{F} = (-y,\; x)\), which swirls anticlockwise round the origin and grows with distance from it, like the figure's whirlpool, and go from \((0, 0)\) to \((2, 1)\) by two different routes.
Route one: east along the \(x\) axis to \((2, 0)\), then north to \((2, 1)\). On the first leg every step is \(d\mathbf{l} = (dx, 0)\), so only \(F_x\) counts. And \(F_x = -y\), which is 0 all along the axis.
On the second leg every step is \((0, dy)\), so only \(F_y\) counts. \(F_y = x\), and \(x\) stays at 2 the whole way up.
So route one collects \(0 + 2 = 2\).
Route two: north first, to \((0, 1)\), then east to \((2, 1)\). Going north, \(F_y = x = 0\) all the way, so that leg gives nothing. Going east, \(F_x = -y\), and \(y\) stays at 1.
Route two collects \(0 - 2 = -2\). Same start, same end, different answer.
So in general a line integral depends on the route, and it makes no sense to ask for "the work from here to there" until you've said which way you went. The surprise is how often physics lets you off.
When only the ends matter
In the figure's landscape, and with the steady push, every route between the same two points gave the same total. Those forces have something in common: each is the downhill slope of a height map, \(\mathbf{F} = -\nabla U\), as at the end of the gradient lesson. Here is why that makes the route irrelevant.
Take one short step, \(d\mathbf{l} = (dx, dy)\), and ask how much \(U\) changes over it. Going east by \(dx\) changes it by the slope going east times \(dx\), and going north by \(dy\) changes it by the slope going north times \(dy\).
Look at the shape of that: matching components multiplied and added. It's a dot product, of the gradient with the step.
The force is minus the gradient, so the work on this step is minus the change in \(U\).
Now add up all the steps from the start, call it \(P\), to the end, \(Q\). The changes in \(U\) add up to the whole change in \(U\), whatever happened along the way.
If \(\mathbf{F} = -\nabla U\), then
Only the two ends matter, and round any closed loop the total is zero.
This is the fundamental theorem again, along a path instead of a line: adding up a slope gives back the change in height. A force of this kind is called conservative, and \(U\) is its potential energy. Gravity is one, which is why work and energy could say that only the height dropped matters. The steady push is another, with \(U = -2x\): a plain slope, downhill to the east. The force between electric charges is a third, and its height map is what voltage measures.
The whirlpool is not one. A line integral round a closed loop is written \(\oint\), and called the circulation of the field round that loop:
Routes one and two above make a loop if you go out by one and come back by the other. Coming back reverses every step, which flips the sign, so the circulation is \(2 - (-2) = 4\), not zero. No height map could do that. You'd walk round and arrive back where you started, at a different height. What the circulation does measure is the subject of divergence and curl and of Stokes's theorem. It's also how a generator works: a changing magnetic field makes an electric field whose circulation round a loop of wire isn't zero, so it drives charge round and round. That's induction.
Adding up across a surface
The second sum asks a different question. A field doesn't only push along paths. It also passes through surfaces, and the amount passing through is called flux. Water is the easiest field to picture: its arrows are the velocity of the flow.
- Turn the net to \(0^\circ\), square-on to the flow. It catches all it can: 2.0 m/s through 0.50 m² is 1.00 m³ of water every second.
- Turn it to \(60^\circ\). The same net now catches only half as much, because from upstream it looks half as big. Its shadow on the far end of the channel shows the size the flow sees.
- Turn it to \(90^\circ\), edge-on. The water slides past and none goes through.
- Carry on to \(120^\circ\) and \(180^\circ\). Water is going through again, but against the net's arrow, and the flux counts as negative: \(-0.50\), then \(-1.00\).
- Go back to \(0^\circ\). Halve the speed to 1.0 m/s and the flux halves. Double the area to 1.00 m² and it doubles.
Three things set how much goes through: how strong the flow is, how big the net is, and how squarely the net faces the flow. One dot product holds all three, once the surface has an arrow of its own. Give a flat surface an area vector \(\mathbf{A}\): it sticks out square to the surface, and its length is the surface's area. Then for a field \(\mathbf{F}\) that's the same all over the surface (any field, not only a force),
where \(\Phi\) (phi) is the flux and \(\theta\) is the angle between the field and the area vector. Square-on, \(\theta = 0\) and the flux is field times area. Edge-on, \(\theta = 90^\circ\) and it's zero. A surface has two sides, so you have to choose which way \(\mathbf{A}\) points, and that choice decides which direction of flow counts as positive.
If the field varies from place to place, or the surface curves, cut the surface into patches small enough to be flat, each with its own small area vector \(d\mathbf{A}\), and add up \(\mathbf{F}\cdot d\mathbf{A}\) over them all. That's a double integral, with a dot product inside it:
Some books write \(d\mathbf{S}\) for the same little arrow.
Often you can do one of these without integrating anything, by choosing a surface the field meets square-on at the same strength everywhere. Here is the most important one. Something at the origin sends a field straight out in all directions, weakening with the square of the distance: at distance \(r\) its strength is \(\frac{C}{r^2}\), for some fixed number \(C\). Light from a lamp does this, and so does the electric field of a charge. How much passes out through a sphere of radius \(R\) centred on it?
On the sphere the field points straight outwards, and so does every patch's area vector. So \(\theta = 0\) on every patch, and each patch's flux is just the strength there times its area.
The strength is the same all over the sphere, so it comes out of the sum, and what's left is the sum of all the patches' areas: the area of the sphere, \(4\pi R^2\).
The \(R^2\) cancels.
The radius has gone. A bigger sphere meets a weaker field, but has more area by exactly the same factor, so every sphere catches the same total. Nothing is lost on the way out and nothing is added. For the electric field, that total counts the charge inside, and that statement is Gauss's law.
Maxwell's four equations are two statements about flux and two about circulation. The flux of the electric field out through any closed surface counts the charge inside it. The flux of the magnetic field out through any closed surface is always zero. The circulation of the electric field round a loop is set by how fast the magnetic flux through the loop is changing, and the circulation of the magnetic field round a loop is set by the current passing through it, together with how fast the electric flux through it is changing. And the line integral of the magnetic potential round a loop is what shifts the fringes in the Aharonov–Bohm experiment. All of it is written in the two sums of this lesson.
Problems
You drag a crate once round the edge of a room 4 m by 3 m, back to where it started. Friction on the crate is a steady 20 N, always pointing against the way it's moving. How much work does friction do on the crate? Could friction be the downhill slope of some height map?
Answer
Friction is always directly against the motion, so on every step \(F_\parallel = -20\) N. The path is \(4 + 3 + 4 + 3 = 14\) m long, so \(W = -20 \times 14 = -280\) J.
That's a closed loop with a total that isn't zero, so no. Friction isn't conservative, which is why the work-energy lesson said there's no such thing as friction potential energy.
Wind blows at a steady 5 m/s towards an open window 1.2 m wide and 0.8 m high. How much air passes through each second if the wind meets the window square-on? And if the wind's direction is \(30^\circ\) away from square-on?
Answer
The window's area is \(1.2 \times 0.8 = 0.96\) m². Square-on, the flux is \(5 \times 0.96 = 4.8\) m³ of air each second.
At \(30^\circ\) the flux is speed times area times \(\cos\theta\): \(5 \times 0.96 \times \cos 30^\circ \approx 4.16\) m³/s.
For the force \(\mathbf{F} = (y,\; x)\), find the work from \((0, 0)\) to \((2, 1)\) by the two routes used above: east then north, and north then east. Then check that \(U = -xy\) is its height map, and use it to get the same answer in one line.
Answer
East then north. Along the \(x\) axis \(F_x = y = 0\), so that leg gives 0. Going up at \(x = 2\), \(F_y = x = 2\), so \(\int_0^1 2\,dy = 2\). Total: 2.
North then east. Going up the \(y\) axis \(F_y = x = 0\), giving 0. Going east at \(y = 1\), \(F_x = y = 1\), so \(\int_0^2 1\,dx = 2\). Total: 2 again.
The height map: \(-\nabla U = -\left(\frac{\partial U}{\partial x},\; \frac{\partial U}{\partial y}\right) = -(-y,\; -x) = (y,\; x)\), which is \(\mathbf{F}\). So the work is \(U(0, 0) - U(2, 1) = 0 - (-2) = 2\), by any route at all.
For the swirling force \(\mathbf{F} = (-y,\; x)\), find the circulation round the rectangle with corners \((0, 0)\), \((2, 0)\), \((2, 1)\) and \((0, 1)\), taken anticlockwise in that order. Do each of the four sides in turn.
Answer
Bottom, going east at \(y = 0\): \(F_x = -y = 0\), so 0.
Right side, going north at \(x = 2\): \(F_y = x = 2\), so \(\int_0^1 2\,dy = 2\).
Top, going west at \(y = 1\): \(F_x = -1\), and \(x\) runs from 2 down to 0, so \(\int_2^0 (-1)\,dx = \big[-x\big]_2^0 = 0 - (-2) = 2\). The force points west there and so do you, so it helps.
Left side, going south at \(x = 0\): \(F_y = x = 0\), so 0.
The circulation is \(0 + 2 + 2 + 0 = 4\). It matches the worked example: out by route one and back by route two.
The same force, \(\mathbf{F} = (-y,\; x)\), once anticlockwise round a circle of radius 3 centred on the origin. You don't need to integrate. How long is the arrow \(\mathbf{F}\) at a point on the circle, and which way does it point compared with the path?
Answer
At the point \((x, y)\) the force has length \(\sqrt{y^2 + x^2}\), which on this circle is 3. It's square to the line from the centre, since \((-y, x)\cdot(x, y) = -xy + xy = 0\), so it points along the circle, the anticlockwise way. That makes \(F_\parallel = 3\) on every step.
The path is \(2\pi \times 3 = 6\pi\) long, so the circulation is \(3 \times 6\pi = 18\pi \approx 56.5\).
A charge \(q = 2 \times 10^{-9}\) C makes an electric field of strength \(E = \frac{kq}{r^2}\) pointing straight out from it, with \(k = 8.99 \times 10^9\) N m²/C². Find the field's strength 0.5 m away and 3 m away. Then find its flux through a sphere of each radius centred on the charge.
Answer
\(kq = 8.99 \times 10^9 \times 2 \times 10^{-9} = 17.98\) N m²/C.
At 0.5 m: \(E = \frac{17.98}{0.5^2} = 71.92\) N/C. The sphere's area is \(4\pi \times 0.5^2 = \pi \approx 3.1416\) m², so the flux is \(71.92 \times 3.1416 \approx 225.9\) N m²/C.
At 3 m: \(E = \frac{17.98}{3^2} \approx 1.998\) N/C. The area is \(4\pi \times 3^2 = 36\pi \approx 113.1\) m², so the flux is \(1.998 \times 113.1 \approx 226.0\) N m²/C.
The two agree, apart from rounding: both are \(4\pi kq\), which is the \(4\pi C\) of the worked example with \(C = kq\). The field is 36 times weaker on the big sphere, and the sphere has 36 times the area.