The exponential & error function solutions in diffusion
In solving the equations governing non-steady-state diffusion, a change of independent variables helps:
In 1894, Ludwig Boltzmann (Ann. Phys. 53, 960) introduced this variable substitution to integrate the nonlinear diffusion equation (Fick’s second law):
When applying Fick's first law, we consider diffusion through a membrane of finite thickness; similarly, there is a finite time required to reach steady-state diffusion through the foil. Boltzmann recognised that with Fick's second law, given the boundary conditions c{z, 0} = c0 and c{0, t} = cs, the physical system possesses no characteristic length scale or time scale. As a consequence, the concentration cannot depend independently on space z and time t, but rather, on the ratio η = z / √t.
With the transformation of variables, the partial differential equation with two independent variables becomes a single, solvable ordinary differential equation:
Exponential and error function solutions
For a concentration-independent diffusion coefficient (D = const), substituting η = z / (2√[Dt]) into Fick’s second law proceeds by the multivariate chain rule. Differentiating c{η} with respect to time:
Differentiating with respect to space:
Evaluating the second spatial derivative:
Equating the temporal and spatial derivatives via Fick’s second law (∂c/∂t = D ∂2c/∂z2):
On multiplying by 4t this becomes :
Exponential solution
Defining a gradient variable p{η} = dc/dη separates the first-order differential equation directly:

Exponential solution, thin plate on semi-infinite bar.
Error function solution
Integrating p{η} from 0 to η yields the integral:
Applying the standard semi-infinite boundary conditions (c = cs at η = 0, and c → c0 as η → ∞), and the definition of the error function erf{η} = (2/√π} ∫0η exp{-ξ2} dξ:

Error function solution, diffusion couple of two semi-infinite bars.