Reference: Daniel V. Schroeder, An Introduction to Thermal Physics, (Addison-Wesley, 2000) – Problem 1.69.
The process of diffusion obeys a partial differential equation very similar to the heat equation. In fact, the derivation is almost identical, except that we are considering the flow of molecular number rather than energy. In diffusion, the rate at which molecules diffuse per unit area and per unit time is given by the flux . Suppose we have a narrow pipe filled with fluid or gas, and that the molecular concentration varies only along the length of the pipe. Consider two adjacent narrow slices within the pipe, each of width . The first slice is bounded by and and the second slice by and . According to Fick’s law
the number of molecules entering slice 2 from slice 1 in time is
where is the cross-sectional area of the slice.
Similarly, the number of molecules flowing out of the second slice on the other side is
The difference is the net change in the number of molecules in the second slice, so
Combining these equations we get
Dividing both sides by the volume of the slice and using the molecular concentration on the LHS we get
In the limit of the RHS becomes the second derivative and we get the diffusion equation, or Fick’s second law:
Since this equation is formally equivalent to the heat equation, its solutions are the same. In particular, if we start with any concentration distribution, it will gradually spread out over time until the concentration is the same everywhere.