Integrals

Integral of e^(−x²): The Gaussian Integral = √π

Integral of e^(−x²): The Gaussian Integral = √π — CalculusCalc cover image

Quick answer: \( e^{-x^2} \) has no antiderivative made of elementary functions, so \( \int e^{-x^2}dx \) can’t be written with polynomials, roots, exponentials, logs or trig. But over the whole real line the area is exactly

$$\int_{-\infty}^{\infty}e^{-x^2}\,dx = \sqrt{\pi}$$

This is the Gaussian integral, the reason \( \sqrt{\pi} \) appears in the normal distribution. Below you’ll see why no formula exists, a complete proof of the \( \sqrt\pi \) result with every step explained, how to handle finite limits, seven worked examples, and the mistakes students make most often.

Why the area is finite

The graph of \( e^{-x^2} \) is the classic bell curve: height 1 at \( x = 0 \), symmetric about the y-axis, and flattening toward zero on both sides. The integral runs over an infinite interval, so it’s an improper integral, and it isn’t obvious that the area is finite.

It is, because the tails vanish incredibly fast. For \( x \ge 1 \), \( x^2 \ge x \), so \( e^{-x^2} \le e^{-x} \). The area under \( e^{-x} \) from 1 to infinity is only \( \frac1e \), so the area under the smaller curve \( e^{-x^2} \) is finite too. By symmetry the left tail behaves the same way, and the middle piece is a continuous function on a bounded interval. Put together, the total area is finite. The surprise is what it equals.

Why u-substitution doesn’t work

For \( \int xe^{-x^2}dx \), u-substitution with \( u = -x^2 \) works because the \( x \) in front is (up to a constant) the derivative of \( -x^2 \):

$$\int xe^{-x^2}\,dx = -\frac12e^{-x^2} + C$$

Without that \( x \), there is nothing to cancel \( du = -2x\,dx \). Liouville’s theorem in fact proves no elementary antiderivative exists. Integration by parts doesn’t rescue you either: every choice of parts produces an integral at least as hard as the original.

The polar coordinates proof

Call the integral \( I \). Multiply it by itself, using \( y \) for the second copy. Because the two integrals involve different variables, their product is a single double integral over the whole plane:

$$\begin{aligned} I^2 &= \int_{-\infty}^{\infty}e^{-x^2}dx\int_{-\infty}^{\infty}e^{-y^2}dy \\ &= \iint_{\mathbb{R}^2}e^{-(x^2+y^2)}\,dA \end{aligned}$$

The integrand depends only on \( x^2 + y^2 \), the squared distance from the origin, so the surface is a round bump. Round shapes call for polar coordinates, where \( x^2 + y^2 = r^2 \) and \( dA = r\,dr\,d\theta \):

$$\begin{aligned} I^2 &= \int_0^{2\pi}\int_0^{\infty}e^{-r^2}r\,dr\,d\theta \\ &= 2\pi\cdot\left[-\frac12e^{-r^2}\right]_0^{\infty} \\ &= 2\pi\cdot\frac12 = \pi \end{aligned}$$

The extra \( r \) is exactly what makes the inner integral solvable: it supplies the missing factor that blocked substitution in one dimension. Since \( I > 0 \), \( I = \sqrt\pi \).

Geometrically, \( I^2 \) is the volume under the bump. Slicing that volume into thin cylindrical shells of radius \( r \) gives shells of area \( 2\pi r\,e^{-r^2}\,dr \), and adding them up gives \( \pi \).

Useful consequences

Integral Value
\( \int_0^{\infty}e^{-x^2}dx \) \( \frac{\sqrt\pi}{2} \)
\( \int_{-\infty}^{\infty}e^{-ax^2}dx \) \( \sqrt{\pi/a} \)
\( \int_0^{\infty}xe^{-x^2}dx \) \( \frac12 \)
\( \int_{-\infty}^{\infty}x^2e^{-x^2}dx \) \( \frac{\sqrt\pi}{2} \)

The normal distribution \( \frac{1}{\sqrt{2\pi}}e^{-x^2/2} \) integrates to 1 because of the second row with \( a = \frac12 \).

Worked examples

Example 1 (half line). The bell curve is even, so the area from 0 to infinity is half the total: \( \frac{\sqrt\pi}{2} \approx 0.8862 \).

Example 2 (a coefficient). For the integral of \( e^{-3x^2} \) over the real line, substitute \( u = \sqrt3\,x \), so \( dx = \frac{du}{\sqrt3} \). The integral becomes \( \frac{1}{\sqrt3} \) times the Gaussian integral:

$$\int_{-\infty}^{\infty}e^{-3x^2}\,dx = \frac{\sqrt\pi}{\sqrt3} = \sqrt{\frac{\pi}{3}}$$

A bigger coefficient makes the bell narrower, so the area shrinks.

Example 3 (a shift). Sliding the bell sideways doesn’t change its area. With \( u = x - 2 \), the integral of \( e^{-(x-2)^2} \) over the real line is still \( \sqrt\pi \).

Example 4 (the x² moment). Use integration by parts with \( u = x \) and \( dv = xe^{-x^2}dx \), so \( v = -\frac12e^{-x^2} \). The boundary term \( -\frac x2e^{-x^2} \) is 0 at both infinities, leaving half the Gaussian integral:

$$\int_{-\infty}^{\infty}x^2e^{-x^2}\,dx = \frac12\int_{-\infty}^{\infty}e^{-x^2}\,dx = \frac{\sqrt\pi}{2}$$

Example 5 (normal distribution). With \( a = \frac12 \), the area under \( e^{-x^2/2} \) is \( \sqrt{2\pi} \). Dividing by \( \sqrt{2\pi} \) makes the total exactly 1, which is why that constant appears in the standard normal density.

Example 6 (complete the square). For the integral of \( e^{-x^2 + 2x} \) over the real line, rewrite the exponent as \( -(x - 1)^2 + 1 \). The factor \( e^1 \) comes out, and the rest is a shifted Gaussian:

$$\int_{-\infty}^{\infty}e^{-x^2+2x}\,dx = e\int_{-\infty}^{\infty}e^{-(x-1)^2}\,dx = e\sqrt\pi$$

Example 7 (finite limits by series). For the area from 0 to 1, integrate the Taylor series term by term:

$$\int_0^1 e^{-x^2}dx = 1 - \frac13 + \frac1{10} - \frac1{42} + \frac1{216} - \frac1{1320} + \cdots$$

Six terms already give about 0.74673, and the true value is 0.746824. Because the series alternates, the error is smaller than the first term you drop. The next term is \( \frac{1}{9360} \), roughly 0.0001, which matches the gap you see. This is how calculators and software actually evaluate erf for small inputs: a few terms of a series, not a closed-form formula. For large inputs, where the series converges slowly, they switch to other approximations of the tail.

Finite limits: the error function

For finite limits, mathematicians named the antiderivative:

$$\operatorname{erf}(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$$

So \( \int_0^1 e^{-x^2}dx = \frac{\sqrt\pi}{2}\operatorname{erf}(1) \approx 0.746824 \). Numerically, you can get it from a Taylor series (integrate \( 1 - x^2 + \frac{x^4}{2} - \dots \) term by term) or from Simpson’s rule. The factor \( \frac{2}{\sqrt\pi} \) is chosen so that erf approaches 1 as \( x \) goes to infinity. In that sense, every indefinite integral of \( e^{-x^2} \) can be written as \( \frac{\sqrt\pi}{2}\operatorname{erf}(x) + C \).

Common mistakes

  1. Inventing an antiderivative. Answers like \( -\frac{e^{-x^2}}{2x} \) fail the derivative test. There is no elementary formula; use erf or a numerical value.
  2. Confusing \( e^{-x^2} \) with \( (e^{-x})^2 \). The second is \( e^{-2x} \), which integrates easily. The exponent is \( -(x^2) \), not \( (-x)^2 \) or a squared exponential.
  3. Forgetting the r in polar coordinates. Without \( dA = r\,dr\,d\theta \), the inner integral is as impossible as the original.
  4. Dropping the square root. The proof gives \( I^2 = \pi \). The integral itself is \( \sqrt\pi \), and you pick the positive root because the integrand is positive.
  5. Using the wrong constant for other widths. For \( e^{-ax^2} \), the area is \( \sqrt{\pi/a} \), not \( \frac{\sqrt\pi}{a} \).

Where it’s used

This integral is the foundation of the normal distribution in statistics, where it guarantees that probabilities add up to 1. It appears in the heat equation, which describes how temperature spreads, and in quantum mechanics as the ground-state wave function of a harmonic oscillator. It also gives the famous value \( \Gamma\left(\frac12\right) = \sqrt\pi \) for the gamma function, since substituting \( t = x^2 \) turns one integral into the other.

Compute it yourself

The solver evaluates this improper integral numerically and recognizes the exact value \( \sqrt\pi \):

Step-by-step solverExact symbolic engine

Interactive Calculus Problem Solver

Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.

Try:
Input syntax
  • Powers x^2, roots sqrt(x), cbrt(x), absolute value |x|
  • Implicit multiplication works: 3x sin(2x)
  • sin cos tan sec csc cot, asin acos atan, sinh cosh tanh
  • e^x or exp(x); ln(x) and log(x) are both the natural log
  • Constants pi and e; bounds accept inf and -inf
Enter a function and press Solve to see a full worked solution.

For finite limits such as 0 to 1, the definite integral calculator gives the decimal value directly.

Practice problems

Try these before checking the answers.

  1. \( \int_{-\infty}^{\infty}e^{-4x^2}\,dx \)
  2. \( \int x^3e^{-x^2}\,dx \), using \( u = x^2 \)
  3. \( \int_0^{\infty}x e^{-x^2/2}\,dx \)
  4. \( \int_{-\infty}^{\infty}e^{-(x+3)^2}\,dx \)
  5. \( \int_{-\infty}^{\infty}e^{-x^2/2}\,dx \)
  6. \( \int_0^{\infty}e^{-9x^2}\,dx \)

Answers: (1) \( \frac{\sqrt\pi}{2} \); (2) \( -\frac12(x^2 + 1)e^{-x^2} + C \); (3) \( 1 \); (4) \( \sqrt\pi \); (5) \( \sqrt{2\pi} \); (6) \( \frac{\sqrt\pi}{6} \).

FAQ

Is the integral of e^(−x²) equal to −e^(−x²)/(2x)?

No. Differentiating that expression does not give back \( e^{-x^2} \), because the \( \frac{1}{2x} \) factor also gets differentiated.

What about e^(x²)?

It also has no elementary antiderivative, and \( \int_{-\infty}^{\infty}e^{x^2}dx \) diverges because the function grows without bound.

Why does the answer involve π when there are no circles?

The circle is hidden in the proof. Squaring the integral creates a round bump over the plane, and its volume is computed in polar coordinates, where \( \pi \) comes from going once around.

What is the integral of e^(−x²) from 0 to infinity?

It’s \( \frac{\sqrt\pi}{2} \approx 0.8862 \), half of the full Gaussian integral, because the function is even.

What is erf(x)?

The error function, \( \frac{2}{\sqrt\pi} \) times the area under \( e^{-t^2} \) from 0 to \( x \). It’s the standard name for the antiderivative that elementary functions can’t express.

Further reading

Calculators for this topic

Leave a comment

Your email address will not be published. Required fields are marked *