Formula and Method for the Error Function
The error function erf(x) is defined as erf(x) = (2/√π) ∫₀ˣ e−t² dt — twice the area under the standard Gaussian curve e−t² between 0 and x, scaled so the total area from 0 to infinity equals 1. It has no elementary closed-form antiderivative, so every calculator — including this one — evaluates it numerically. This tool also reports the complementary error function erfc(x) = 1 − erf(x) and the equivalent standard normal distribution values, since erf is the mathematical backbone of the normal (Gaussian) probability distribution.
How the calculation works
Given x, the calculator numerically integrates e−t² from 0 to x using composite Simpson's rule with 2,000 subintervals, then multiplies by 2/√π to get erf(x). Because erf is an odd function, erf(−x) = −erf(x), so negative inputs are handled by integrating |x| and flipping the sign. From erf(x) the calculator derives erfc(x) = 1 − erf(x), the probability that a standard normal variable falls within |x| standard deviations of the mean, P(|Z| ≤ |x|) = erf(|x|/√2), and the standard normal cumulative distribution function Φ(x) = ½[1 + erf(x/√2)].
Common mistakes
- Confusing erf(x) with Φ(x): the standard normal CDF is not erf(x) directly — it's Φ(x) = ½[1 + erf(x/√2)], which rescales the input by 1/√2.
- Mixing up erf and erfc: erfc(x) = 1 − erf(x), not −erf(x); erfc(x) is always between 0 and 2.
- Expecting values outside [−1, 1]: erf(x) is bounded between −1 and 1 for every real x — if a computed value falls outside that range, double-check the inputs.
Real-world applications
- Statistics: converting z-scores to probabilities and building confidence intervals for normally distributed data.
- Heat conduction and diffusion: the temperature profile in a semi-infinite solid after a sudden surface temperature change follows T(x,t) = Ts + (T₀ − Ts)·erf(x / (2√(αt))).
- Semiconductor fabrication: dopant concentration from a constant-source diffusion follows C(x,t) = Cs·erfc(x / (2√(Dt))), from Fick's second law.
- Digital communications: bit-error-rate for signals in Gaussian noise is often written as ½·erfc(√(Eb/N₀)).