practicecalculus
Exponential and log integrals

Integral of e^(x²): Why There Is No Simple Formula

e^(x²) and e^(−x²) have no elementary antiderivative. Learn the erf and erfi functions, the power series answer and why ∫e^(−x²) over ℝ is √π.

Exponential and log integrals Updated 3 min read

At a glance

\int e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}\,\operatorname{erf}(x) + C
Antiderivative
Not elementary. \int e^{x^2}\,dx = \frac{\sqrt{\pi}}{2}\operatorname{erfi}(x) + C
Bell curve version
\int e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}\operatorname{erf}(x) + C
Gaussian integral
\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}
Series form
\int e^{x^2}\,dx = \sum_{n=0}^{\infty}\frac{x^{2n+1}}{n!\,(2n+1)} + C
From 0 to 1
\int_0^1 e^{x^2}\,dx \approx 1.4627 and \int_0^1 e^{-x^2}\,dx \approx 0.7468
On this page
  1. Graph of e^(x²) and e^(−x²)
  2. Why the usual methods fail
  3. The error function
  4. The power series answer
  5. Worked examples
  6. Common mistakes

e^{x^2} has no elementary antiderivative, and neither does the bell curve e^{-x^2}. No formula built from powers, roots, exponentials, logs and trig functions has either one as its derivative. The antiderivatives still exist, and they have names:

\int e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}\,\operatorname{erf}(x) + C \qquad \int e^{x^2}\,dx = \frac{\sqrt{\pi}}{2}\,\operatorname{erfi}(x) + C

And one famous definite integral has an exact value:

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

Graph of e^(x²) and e^(−x²)

y = e^(x²) and the bell curve y = e^(−x²)
The total shaded area under the bell curve, over the whole real line, is \sqrt{\pi} \approx 1.772. The area under e^{x^2} over the whole line is infinite.

Why the usual methods fail

  • Substitution. u = x^2 needs du = 2x\,dx, and there is no x to supply it. Compare \int xe^{x^2}\,dx = \frac{1}{2}e^{x^2} + C, which works.
  • Dividing by the inside derivative. That shortcut only works for a constant inside slope, as in the integral of e²ˣ. Here the slope 2x changes.
  • Integration by parts. Every choice of u and dv leads to a harder integral.

This is not bad luck. Joseph Liouville proved in the 1830s that \int e^{x^2}\,dx cannot be written in elementary terms. Other functions in the same family include \frac{\sin x}{x} and \frac{1}{\ln x}.

The error function

Since the antiderivative exists but has no formula, it gets its own name. The error function is

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

The factor \frac{2}{\sqrt{\pi}} is chosen so that \operatorname{erf}(x) \to 1 as x \to \infty. By the Fundamental Theorem of Calculus, Part 1, its derivative is \frac{2}{\sqrt{\pi}}e^{-x^2}, which gives the formula above. The imaginary error function \operatorname{erfi}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{t^2}\,dt plays the same role for e^{x^2}.

The error function is everywhere in statistics, since the normal distribution is a stretched copy of e^{-x^2}. Your calculator's normal-distribution function is computing erf behind the scenes.

The power series answer

You can always get an antiderivative as a series. Start from e^u = \sum_{n=0}^\infty \frac{u^n}{n!} with u = x^2, then integrate term by term:

\int e^{x^2}\,dx = \sum_{n=0}^{\infty}\frac{x^{2n+1}}{n!\,(2n+1)} + C = x + \frac{x^3}{3} + \frac{x^5}{10} + \frac{x^7}{42} + \cdots + C

The series converges for every x. For e^{-x^2} the signs alternate: x - \frac{x^3}{3} + \frac{x^5}{10} - \frac{x^7}{42} + \cdots

Check by differentiating. The derivative of \frac{x^{2n+1}}{n!(2n+1)} is \frac{x^{2n}}{n!} = \frac{(x^2)^n}{n!}, and the sum of those is e^{x^2}.

Worked examples

Example 1: a definite integral by series. Put x = 1 into the series:

\int_0^1 e^{x^2}\,dx = 1 + \frac{1}{3} + \frac{1}{10} + \frac{1}{42} + \frac{1}{216} + \cdots \approx 1.4627

Example 2: the bell curve from 0 to 1. The alternating series gives

\int_0^1 e^{-x^2}\,dx = 1 - \frac{1}{3} + \frac{1}{10} - \frac{1}{42} + \frac{1}{216} - \cdots \approx 0.7468

Since the series alternates, the error after stopping is smaller than the first term left out.

Example 3: the Gaussian integral. Call I = \int_{-\infty}^{\infty}e^{-x^2}\,dx. Multiply two copies, one in x and one in y, and switch to polar coordinates, where dx\,dy = r\,dr\,d\theta:

I^2 = \iint_{\mathbb{R}^2} e^{-(x^2+y^2)}\,dx\,dy = \int_0^{2\pi}\!\!\int_0^\infty e^{-r^2}\,r\,dr\,d\theta = 2\pi\cdot\frac{1}{2} = \pi

The extra r is exactly the factor that makes u = r^2 work. So I = \sqrt{\pi}. The polar double integrals lesson covers the change of coordinates.

Example 4: a scaled bell curve. With x = \frac{t}{\sqrt{a}}, \int_{-\infty}^{\infty}e^{-at^2}\,dt = \sqrt{\frac{\pi}{a}} for a > 0.

Common mistakes

  1. Writing \frac{e^{x^2}}{2x} + C. Differentiate it and you will see it does not work.
  2. Assuming every integral has a formula. Some do not. On a test, a definite integral of e^{x^2} usually means "use a series" or "use a calculator".
  3. Mixing up e^{x^2} and (e^x)^2. (e^x)^2 = e^{2x}, which integrates to \frac{1}{2}e^{2x}. e^{x^2} means e raised to x^2.
  4. Forgetting the x test. If the integrand is xe^{x^2} or xe^{-x^2}, a simple substitution works.

For series techniques, see the Taylor series guide. For the simpler exponentials, see the integral of eˣ and the integral of e⁻ˣ.

Practice it now

Common Maclaurin series

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the integral of e^(x²)?

It has no elementary antiderivative. It can be written as \frac{\sqrt{\pi}}{2}\operatorname{erfi}(x) + C, where erfi is the imaginary error function, or as the series \sum_{n\ge 0}\frac{x^{2n+1}}{n!(2n+1)} + C.

Why can you not integrate e^(x²)?

A theorem of Liouville shows that no combination of polynomials, exponentials, logs, trig functions and roots has derivative e^{x^2}. The antiderivative exists, it just is not one of the standard functions.

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

It is \sqrt{\pi} \approx 1.772. Square the integral, switch to polar coordinates and the extra factor r makes the integral easy.

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

No. Differentiating \frac{e^{x^2}}{2x} with the quotient rule gives e^{x^2} - \frac{e^{x^2}}{2x^2}, not e^{x^2}. You can only divide by a constant.

What is the integral of x e^(x²)?

It is \frac{1}{2}e^{x^2} + C. With an x in front, u = x^2 works because du = 2x\,dx is present.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.