James Clerk Maxwell
James Clerk Maxwell

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

James Clerk Maxwell

2 The equation of continuity

The conservation of charge is a basic tenet of electromagnetism. It can be simply expressed by the equation

where Qtot is the total charge in the Universe. However, such an equation does not really help us very much, because we are not usually concerned with anything as grand as the whole Universe. Moreover, it leaves out some important physics.

The most interesting aspect of the law of conservation of charge is that it applies locally as well as globally. If an electron were miraculously created here, and a proton were simultaneously, and equally miraculously, created on Mars, the total charge of the Universe would remain constant. But these two miracles would both violate the law of conservation of charge because they do not conserve charge locally, either here or on Mars. Electric charge is conserved in every region of space. We can therefore make a more powerful statement:

The law of conservation of charge

Any variation in the total charge within a closed surface must be due to charges that flow across the surface.

To express this law in mathematical terms, consider a volume V bounded by the closed surface S (Figure 2). Electric current is defined to be the rate of flow of charge across a surface so the law of conservation of charge tells us that

where I is instantaneous current flowing outwards through S into the exterior space and Q is the instantaneous charge in the enclosed volume V. The minus sign arises because a current flowing outwards across the surface produces a loss of charge within the surface.

Figure 2
Figure 2 The current flowing across the closed surface S tells us the rate of loss of charge in the volume V enclosed by S

Now we can express the current I as a surface integral of the current density J:

Using the divergence theorem, we can also write this as

We can express the charge Q as a volume integral of the charge density ρ:

The rate of change of Q within this volume is therefore

Note the use of ordinary differentiation outside the integral and partial differentiation inside the integral. Ordinary differentiation is appropriate outside the integral because Q(t) is a function of time only. By contrast, the charge density depends on spatial coordinates as well as on time. These spatial coordinates remain fixed, so partial differentiation with respect to time is appropriate inside the integral.

Combining Equations 7.1, 7.2 and 7.3 , we conclude that

The fact that this volume integral vanishes for all volumes (no matter how small) implies that the integrand must be equal to zero everywhere, so we have

This is called the equation of continuity. It applies at each point in space and each instant in time and is a direct expression of the local law of conservation of charge. It is a fundamental fact about electromagnetism which applies in all situations and in all frames of reference.

The case of magnetostatics, where all the currents are steady, is of special importance. In this case, we can argue that ∂ρ/∂t must be equal to zero. For, if ∂ρ/∂t were positive at any particular point, it would remain positive there forever, since all the currents are steady. This would lead to an unphysical boundless build-up of charge. A similar argument rules out a negative value of ∂p/∂t. Therefore realistic steady currents are characterised by

However, this is a very special situation. If the currents are not steady, we would expect concentrations of charge to build up in different regions, and then ebb away. In general, ρ varies in time, and div J ≠ 0.

Exercise 1

A one-dimensional rod is aligned with the z-axis. At any point along the rod, the current density is given by

where k, ω and A are constants. What can be said about the charge density along the rod? You may assume that the time-average of charge density is zero at each point along the rod.


The current density only has a z-component, so the equation of continuity becomes

Integrating with respect to time, the charge density is

where C(z) is an arbitrary function. In general, it is necessary to allow for such a function, which describes a fixed charge density distributed along the rod. However, C(z) is the time-average of the charge density at position z, which is equal to zero according to information given in the question. Hence,


Take your learning further371

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses372.

If you are new to university level study, we offer two introductory routes to our qualifications. Find out Where to take your learning next?373 You could either choose to start with an Access courses374or an open box module, which allows you to count your previous learning towards an Open University qualification.

Not ready for University study then browse over 1000 free courses on OpenLearn375 and sign up to our newsletter376 to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371