Mathwords logoMathwords

Gaussian Function — Definition, Formula & Examples

A Gaussian function is a smooth, symmetric, bell-shaped curve defined by the exponential of a negative quadratic expression. It forms the basis of the normal distribution in statistics and appears throughout science and engineering.

A Gaussian function is a function of the form f(x)=aexp ⁣((xμ)22σ2)f(x) = a \exp\!\left(-\frac{(x - \mu)^2}{2\sigma^2}\right), where a>0a > 0 controls the peak height, μ\mu is the center (mean), and σ>0\sigma > 0 is the standard deviation governing the width. When a=1σ2πa = \frac{1}{\sigma\sqrt{2\pi}}, the function integrates to 1 over (,)(-\infty, \infty) and serves as the probability density function of the normal distribution N(μ,σ2)N(\mu, \sigma^2).

Key Formula

f(x)=1σ2πexp ⁣((xμ)22σ2)f(x) = \frac{1}{\sigma\sqrt{2\pi}}\, \exp\!\left(-\frac{(x - \mu)^2}{2\sigma^2}\right)
Where:
  • xx = The input variable (observed value)
  • μ\mu = The mean — the center of the bell curve
  • σ\sigma = The standard deviation — controls the width of the curve
  • exp\exp = The exponential function, base $e \approx 2.71828$

How It Works

The Gaussian function describes how data clusters around a central value. The parameter μ\mu shifts the bell curve left or right along the xx-axis, while σ\sigma controls the spread: a smaller σ\sigma produces a taller, narrower peak, and a larger σ\sigma produces a shorter, wider one. To use it as a probability density, you set the leading coefficient to 1σ2π\frac{1}{\sigma\sqrt{2\pi}} so the total area under the curve equals 1. You can then compute the probability that a random variable falls in an interval [a,b][a, b] by integrating the Gaussian over that interval, typically using zz-scores and a standard normal table.

Worked Example

Problem: Evaluate the standard normal Gaussian function (μ = 0, σ = 1) at x = 0 and x = 2.
Write the formula for σ = 1, μ = 0: The standard normal density simplifies because σ = 1 and μ = 0.
f(x)=12πex2/2f(x) = \frac{1}{\sqrt{2\pi}}\, e^{-x^2/2}
Evaluate at x = 0: Substitute x = 0. The exponent becomes 0, so e⁰ = 1.
f(0)=12π12.50660.3989f(0) = \frac{1}{\sqrt{2\pi}} \approx \frac{1}{2.5066} \approx 0.3989
Evaluate at x = 2: Substitute x = 2. The exponent is −4/2 = −2.
f(2)=12πe20.3989×0.13530.0540f(2) = \frac{1}{\sqrt{2\pi}}\, e^{-2} \approx 0.3989 \times 0.1353 \approx 0.0540
Interpret: The density at x = 0 is about 7.4 times larger than at x = 2, reflecting how the bell curve is tallest at the mean and drops off rapidly.
Answer: f(0) ≈ 0.3989 and f(2) ≈ 0.0540.

Another Example

Problem: A machine fills bottles with a mean of μ = 500 mL and standard deviation σ = 10 mL. What is the value of the Gaussian density at x = 515 mL?
Compute the z-score: Find how many standard deviations 515 is from the mean.
z=51550010=1.5z = \frac{515 - 500}{10} = 1.5
Compute the exponent: Plug the z-score into the exponent of the Gaussian.
z22=1.522=1.125-\frac{z^2}{2} = -\frac{1.5^2}{2} = -1.125
Evaluate the full expression: Use the normalized Gaussian with σ = 10.
f(515)=1102πe1.125125.066×0.32470.01295f(515) = \frac{1}{10\sqrt{2\pi}}\,e^{-1.125} \approx \frac{1}{25.066} \times 0.3247 \approx 0.01295
Answer: The Gaussian density at 515 mL is approximately 0.0130 per mL.

Visualization

Why It Matters

The Gaussian function is central to any introductory statistics or probability course — the normal distribution built from it models everything from exam scores to measurement errors. In signal processing and physics, Gaussian functions describe laser beam profiles, heat diffusion, and filter kernels. Machine-learning algorithms rely on Gaussian assumptions in techniques like Gaussian naive Bayes, Gaussian mixture models, and Gaussian process regression.

Common Mistakes

Mistake: Confusing the density value f(x) with a probability.
Correction: The value of the Gaussian at a single point is a density, not a probability. To find the probability of an interval, you must integrate the function over that interval. A single-point density can exceed 1 for narrow distributions.
Mistake: Forgetting to square σ in the denominator of the exponent.
Correction: The exponent is (xμ)2/(2σ2)-(x-\mu)^2/(2\sigma^2). Writing 2σ2\sigma instead of 2σ22\sigma^2 changes the shape of the curve entirely. Always check that both the numerator and denominator carry squared terms.