Mathwords logoMathwords

Error Function (erf) — Definition, Formula & Examples

The error function, written erf(x), measures the probability that a normally distributed random variable falls within a certain range of the mean. It equals the area under the bell curve from x-x to xx, scaled so that erf()=1\text{erf}(\infty) = 1.

The error function is defined as erf(x)=2π0xet2dt\text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}\, dt. It is an odd function satisfying erf(x)=erf(x)\text{erf}(-x) = -\text{erf}(x), with erf(0)=0\text{erf}(0) = 0 and limxerf(x)=1\lim_{x \to \infty} \text{erf}(x) = 1.

Key Formula

erf(x)=2π0xet2dt\text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}\, dt
Where:
  • xx = Upper limit of integration (any real number)
  • tt = Dummy variable of integration

How It Works

You cannot evaluate the integral et2dt\int e^{-t^2} dt in terms of elementary functions, so erf is treated as a special function with tabulated values and built-in implementations in calculators and software. To use it, substitute your limit into the definition and look up or compute the result numerically. The complementary error function erfc(x)=1erf(x)\text{erfc}(x) = 1 - \text{erf}(x) is often used when you need the tail probability. Many CDF formulas for the normal distribution are written in terms of erf: Φ(x)=12[1+erf ⁣(x2)]\Phi(x) = \frac{1}{2}\left[1 + \text{erf}\!\left(\frac{x}{\sqrt{2}}\right)\right].

Worked Example

Problem: Use the error function to find the probability that a standard normal variable Z falls between −1 and 1.
Step 1: The CDF of the standard normal distribution relates to erf by:
P(aZa)=erf ⁣(a2)P(-a \le Z \le a) = \text{erf}\!\left(\frac{a}{\sqrt{2}}\right)
Step 2: Substitute a = 1:
P(1Z1)=erf ⁣(12)=erf(0.7071)P(-1 \le Z \le 1) = \text{erf}\!\left(\frac{1}{\sqrt{2}}\right) = \text{erf}(0.7071)
Step 3: Look up or compute the value numerically:
erf(0.7071)0.6827\text{erf}(0.7071) \approx 0.6827
Answer: The probability is approximately 0.6827, confirming the well-known 68% rule for one standard deviation.

Why It Matters

The error function appears throughout heat conduction, diffusion equations, and signal processing wherever Gaussian distributions arise. In statistics courses, understanding erf clarifies how normal distribution tables and CDF values are actually computed. Engineers use erf directly when solving the heat equation for semi-infinite domains.

Common Mistakes

Mistake: Confusing erf(x) with the standard normal CDF Φ(x).
Correction: They are related but not identical. The conversion is Φ(x)=12[1+erf(x/2)]\Phi(x) = \frac{1}{2}[1 + \text{erf}(x/\sqrt{2})]. Mixing them up introduces a scaling error by a factor of 2\sqrt{2}.