# Counting what crosses a boundary

A region gains what enters and loses what leaves. If nothing is made or destroyed inside, the change in its contents is the difference.

Written for this edition, not translated from Einstein.

## If particles keep crossing the edges of a region, what decides whether it fills up or empties?

Take a short stretch of a tube. If more particles cross into it than cross out, the number inside goes up. The flux J counts the net number crossing a surface per unit area and per second, with rightward crossings positive; the concentration c counts particles per unit volume. They measure different things, and the equation below connects them.

$$
\frac{\partial c}{\partial t}=-\frac{\partial J}{\partial x}
$$

The rate at which the concentration changes equals minus the rate at which the flux changes along x.

The minus sign is the bookkeeping. If the rightward flux is larger at the right end of the stretch than at the left, more particles leave on the right than arrive on the left, and the concentration falls.

## Worked example: Seven particles in, five out

1. In one second, 7 particles cross into the stretch and 5 cross out. The count inside rises by 2.
2. Next second, 5 cross in and 5 cross out. The count is unchanged, although 10 particles crossed.

## Where this lesson stops

The contents change by the net crossing. A steady count does not mean the particles have stopped, only that as many leave as arrive.

## This lesson builds on

- [Adding and averaging](/foundations/bridge-sum-average/)
