Non-Elementary Integrals

Some integrals have no formula at all, and Joseph Liouville proved it. Run his test on a polynomial times e−x², see why the answer hangs on one number, then train on integrands where the right answer may be None exists.

For a polynomial g
The name for the missing formula
Loading interactive simulation...

Lesson

The theory — Non-Elementary Integrals

A function is elementary if it can be built from x and constants by finitely many additions, multiplications, divisions, roots of polynomial equations, exponentials and logarithms; complex values are allowed, which brings in the trigonometric functions and their inverses. An integrand has an elementary antiderivative if some elementary F has F′ = f. Liouville's theorem restricts the form such an F can take, and for f·eg with f and g rational, g not constant, it becomes one test: an elementary antiderivative exists exactly when R′ + g′R = f has a rational solution R, and then R·eg is one.

What each symbol means

R
the rational function Liouville's test looks for; for g(x)e−x² it must be a polynomial
K
g₀ + g₂/2 + 3g₄/4 + 15g₆/8 + …, the multiple of ∫e−x² dx left over after integrating by parts: the whole-line area divided by √π

Where the formula comes from

  1. The form any answer must take. Liouville’s theorem narrows the search to one shape: if ∫g(x)e−x² dx has a formula, it is R(x)e−x² for some polynomial R. Differentiate that and ask it to equal g.
  2. Match the powers. For a cubic g, R is a quadratic. The x³ and x terms can always be matched. The x² term and the constant term both fix r₁, once as −g₂/2 and once as g₀, and they agree only when g₀ + g₂/2 = 0.
Breaks when
The test on this page covers f·eg with f and g rational, and through x = eu the integrands xm/ln x. Square roots of polynomials need a different argument: Conrad's Example 4.3 explains why ∫dx/√P(x) is not elementary for P of degree 3 or more without repeated roots, and Hardy credits Liouville with the standard elliptic integrals, an ellipse's arc length among them.

Problems solved in full

  1. The elementary neighbour 2 steps

    Find ∫x e−x² dx.

    1. The x is −½ times the derivative of −x², so substitute:

    2. One exponential:

    Answer

    −½e−x² + C. One factor of x is the whole difference between this integral and ∫e−x² dx, which has no formula at all.

  2. Four decimals from a series 3 steps

    Evaluate ∫01 e−x² dx to four decimal places.

    Show solution
    1. No antiderivative to use, but e−x² has a power series, and it can be integrated term by term:

    2. The terms alternate and shrink, so add them until the next one is too small to matter:

    3. For an alternating series the error is smaller than the first term left out:

    Answer

    0.7468. Stopping one term earlier, at 1/1320, leaves an error bound of 1/9360 ≈ 1.1×10⁻⁴, which cannot vouch for the fourth decimal.

  3. The same method on sin(x²) 2 steps

    Evaluate ∫01 sin(x²) dx to four decimal places.

    Show solution
    1. sin(x²) has no elementary antiderivative either. Its series, integrated term by term:

    2. Three terms, and the fourth bounds the error:

    Answer

    0.3103. This is a Fresnel integral: Augustin Fresnel needed it in 1818 for his theory of the diffraction of light.

  4. Parts, down to the integral that has no formula 3 steps

    Find ∫x² e−x² dx, and its value from 0 to ∞, given ∫0∞ e−x² dx = √π/2.

    Show solution
    1. Split x² e−x² as x · x e−x²; the second factor has the antiderivative of the first problem:

    2. One round of parts leaves ∫e−x² dx, which has no formula, so it stays as it is:

    3. Over [0, ∞) the boundary term is 0 at both ends and the integral left is known:

    Answer

    −½x e−x² + (√π/4) erf x + C, and √π/4 ≈ 0.4431 over [0, ∞). erf is the name given to the integral that has no formula, scaled so that it tends to 1.

  5. Two pieces without formulas that add up to one 1 steps

    Find ∫ex(1/x − 1/x²) dx for x > 0.

    Show solution
    1. Neither ∫eˣ/x dx nor ∫eˣ/x² dx is elementary. But differentiate eˣ/x by the quotient rule:

    Answer

    eˣ/x + C. Liouville’s theorem is about the whole integrand: a sum can have a formula when neither of its terms does.

  6. Which c makes (4x⁴ + c)e^(−x²) integrable? 4 steps

    For which c does (4x⁴ + c)e−x² have an elementary antiderivative, and what is it? The page's boxes stop at x³. Press Balanced for the same question one degree lower.

    Open this problem in the tool

    Show solution
    1. Integrating by parts, each x2m leaves (2m − 1)!!/2m times ∫e−x² dx behind; for x⁴ that weight is 3/4. Add up the leftovers:

    2. A formula needs the leftover to vanish:

    3. Then R has degree 3. Matching powers of R′ − 2xR = 4x⁴ − 3 from the top down:

    4. Check by differentiating:

    Answer

    c = −3, and ∫(4x⁴ − 3)e−x² dx = −(2x³ + 3x)e−x² + C. Any other c leaves (c + 3)∫e−x² dx behind, which has no formula, and the whole-line area is then (c + 3)√π instead of zero.

“No formula” for e⁻ˣ² is a theorem 🖖

Press The bell curve. The trainer asks for ∫3e−x² dx, and the right answer is None exists. Nobody is waiting for a cleverer substitution: Joseph Liouville proved in the 1830s that no combination of powers, roots, exponentials, logarithms and trigonometric functions, however long, has e−x² as its derivative. Given Liouville's theorem, the last step fits in a paragraph, and Brian Conrad's notes give it: if an elementary antiderivative existed, one would have the form R(x)e−x² with R a rational function, so R′ − 2xR = 1. A polynomial R makes the left side's degree too high; a pole of R gives R′ a pole of one order more, which nothing on either side cancels. And yet the antiderivative exists. The lower panel draws it from Simpson's rule, a smooth rising curve, and the results print ∫₀¹ 3e−x² dx = 2.2405. What is missing is a formula, not a function, and mathematicians named a scaled copy of it: the error function erf(x) = (2/√π)∫₀ˣ e−t² dt, so the trainer’s antiderivative is (3√π/2)·erf(x) + C. Press 1/ln x: the same theorem, through x = eu, rules out a formula for the logarithmic integral ∫dx/ln x, and the page draws that antiderivative just the same.

Times a polynomial, e⁻ˣ² has a formula exactly when its area over the whole line is zero 🖖

Liouville's test can be run, not just quoted. Type a cubic g into the boxes and step through it: any formula for ∫g(x)e−x² dx would have to be R(x)e−x² with R a polynomial, so R′ − 2xR must equal g, and matching powers from the top down either finds R or ends in a contradiction at the constant term. Press x²·e⁻ˣ². The steps force R = −½x and then ask −½ to equal 0, so there is no formula, and the area over the whole line is √π/2 = 0.8862. Press Balanced, (2x² − 1)e−x²: the steps find R = −x, so the integral is −xe−x² + C, and the area is 0.0000. The two facts are one fact. A formula R(x)e−x² dies away at both ends, so the area between them, F(∞) − F(−∞), is zero; and integrating by parts reduces every x2me−x² to a formula plus a fixed multiple of ∫e−x² dx, a multiple that adds up to the area divided by √π. In numbers: a formula exists exactly when g₀ + g₂/2 = 0, and the odd powers never matter. The green and red shading make it visible: they must cancel.

Count the integrands in a family and those with a formula all but vanish 🖖

Liouville's theorem is about the integrand in front of you. It does not say what fraction of integrals have no formula, and cannot, because “most” needs a family and a way of counting. So count a family. Take every cubic g with integer coefficients from −3 to 3, 2,401 of them. Times e−x², 147 have an elementary antiderivative, 6.12%, and they are exactly the ones with g₂ = −2g₀: three lit cells of the 49 in the grid, with g₁ and g₃ free. Widen the coefficients to −10 … 10 and the share drops to 2.49%; to −100 … 100, 0.25%; each tenfold widening divides it by about ten, as the table shows. A formula needs one exact coincidence among the coefficients, and an exact coincidence is a line drawn through a square that keeps growing. The trainer gives you a formula about half the time only because it was built to; drawn at random from this family, almost no integrand would have one.

Learning path

Techniques of integration

References (2)
Further reading (1)