# 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 √π.

Source: https://practicecalculus.com/integrals/e-to-the-x-squared
Updated: 2026-11-06

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

## At a glance

- **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$

## Key takeaways

- Neither $e^{x^2}$ nor $e^{-x^2}$ has an antiderivative made of ordinary functions. This is a proven fact, not a gap in technique.
- Mathematicians name the antiderivatives: $\int e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}\operatorname{erf}(x) + C$ and $\int e^{x^2}\,dx = \frac{\sqrt{\pi}}{2}\operatorname{erfi}(x) + C$.
- You can always write the antiderivative as a power series by integrating the Maclaurin series term by term.
- The Gaussian integral $\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$ is computed with polar coordinates, not with an antiderivative.

**$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²)

```graph
title: 'y = e^(x²) and the bell curve y = e^(−x²)'
caption: '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.'
x: [-3, 3]
y: [-0.5, 4]
functions:
  - expr: exp(-x^2)
    label: y = e^(−x²)
  - expr: exp(x^2)
    label: y = e^(x²)
    dashed: true
    domain: [-1.17, 1.17]
shade:
  expr: exp(-x^2)
  from: -3
  to: 3
points:
  - [0, 1, '(0, 1)']
```

## 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²ˣ](/integrals/e-to-the-2x). 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](/theorems/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](/learn/calculus-3/multiple-integrals/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](/blog/taylor-series). For the simpler exponentials, see the [integral of eˣ](/integrals/e-to-the-x) and the [integral of e⁻ˣ](/integrals/e-to-the-negative-x).

## 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.
