Every student that has ever taken an introductory materials science course has most likely solved a diffusion problem involving the error function. Carburizing steel is the most common problem; where a low carbon steel is held in a gas atmosphere that produces a surface carbon content that is usually above 1 weight percent. A carbon potential of a gas atmosphere is defined by the carbon content developed at the steel surface in contact with the atmosphere. Two equivalent solutions to the carburization problem are given below; where C(x,t) is the new carbon level at a distance x from the surface, C0 is the base carbon content, CS is the carbon potential, D is the diffusivity and t is the carburization time.

The function erf(z) is called the error function and has the following mathematical properties: the error function is antisymmetric, erf(-z)=-erf(z), is equal to zero at z=0 and asymptotically approaches a value of one at large values of z. Tabulated values of erf(z) are derived from the following infinite series:

Interpolation of tabulated values is often required to solve the diffusion problem because the error function series requires a large number of terms to be accurate. Thus, calculating a carbon profile using the error function table can be very time consuming.
There are simple approximations for the error function that are adequate for engineering calculations and for incorporation into spreadsheet programs. For quick calculations using a hand calculator, the error function can be broken down piecewise using the following equations:

A very convenient approximation for the error function, which can be incorporated into spreadsheet calculations, is given by the following polynomial equation.

Figure 1 shows a comparison of the piecewise and polynomial approximations with values obtained from an error function table. Values obtained from the series solution using the first four and first seven terms in the series are also included in the figure. As can be seen in Figure 1, the series function deviates dramatically when z becomes greater than 0.9 indicating that the series must be continued to much higher order terms as the value of z increases.

Using the polynomial solution, carburization profiles were calculated and are shown in Figure 2. These profiles were determined for a 1022 plain carbon steel held at 927°C (1700°F) with a carbon potential of 1.1 weight percent. The diffusivity was calculated from the presented equation, where the absolute temperature (T) is measured in degrees Kelvin.

Fig. 1. A graphical representation of the error function that shows that the approximations given for erf(z) compare favorably with the tabulated values. In contrast, the series representation begins to deviate drastically for values above z=0.9 when only a few of the series terms are used.

Fig. 2. Carburization profiles for a 1022 steel held in an atmosphere that produces a carbon potential of 1.1 weight percent carbon for various times at 927°C. These calculations were made using the polynomial approximation for the error function.