Calculus & Analysis

Error Function

Connect Gaussian area to erf, its complement and its derivative.

By Riano · Published · Updated · Report a correction

Error Function

The Error Function, commonly denoted as erf(x), is a special function of a sigmoid shape that occurs in probability, statistics, and partial differential equations. It is fundamentally defined by the integral of the Gaussian function over the interval from 0 to x. Note that while erf(x) shares a sigmoid shape with the Cumulative Distribution Function (CDF) of a normal distribution, they differ in scale and domain center; a standard normal CDF integrates from negative infinity to x, whereas erf(x) integrates from 0 to x.

Worked Example

Let's approximate the value of erf(x) for x = 0.5. The Maclaurin series expansion for the Error Function is:

erf(x) = (2 / √π) * (x - x³/3 + x⁵/10 - x⁷/42 + ...)

Substituting x = 0.5 into the first three terms of the series gives:

  1. Term 1: x = 0.5
  2. Term 2: -(0.5)³ / 3 = -0.125 / 3 ≈ -0.0416667
  3. Term 3: (0.5)⁵ / 10 = 0.03125 / 10 = 0.003125

Summing these terms inside the parentheses: 0.5 - 0.0416667 + 0.003125 = 0.4614583. Multiplying by (2 / √π) ≈ 1.128379 gives erf(0.5) ≈ 1.128379 * 0.4614583 ≈ 0.5207. This closely matches the highly precise numerical evaluation of 0.5204998778130465.

Experiment

In the interactive module at https://riano.app/module/error-function, you can visualize the Error Function, its derivative, and the Gaussian integral.

  1. Select the Probe x control to evaluate at different points.
  2. Set the probe to x = 0. Notice the Gaussian curve peaks at 1, but erf(0) is exactly 0 and the Gaussian integral is 0.
  3. Change the probe to x = 1. Observe the shaded Gaussian integral region expanding from 0 to 1, and erf(1) reading approximately 0.8427.
  4. Change the probe to x = -2. The Gaussian integral becomes negative, reflecting the odd symmetry of erf(x) where erf(-x) = -erf(x).

Limitations

The implementation uses a finite Taylor series expansion bounded to 40 terms, which provides very high accuracy (at least 15 significant digits) for the small domain of x ∈ [-2, 2]. However, for large values of |x| outside this bound, the Taylor series convergence becomes extremely slow and suffers from catastrophic cancellation in floating-point arithmetic. For large |x|, asymptotic expansions or continued fractions are usually required in robust mathematical libraries.

References

These references establish the exact analytical connections between the integral of the Gaussian distribution and the error function used in this module.

Experience it interactively

Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Error Function module.

Try Error Function on Riano →

More in Calculus & Analysis