Non-Elementary Integration

Study Sheet

Non-Elementary Integration

Feynman's trick, King's and Queen's rules, Glasser's master theorem, and friends

Integrals With No Antiderivative

Concept
Why a new toolkit is needed

Plenty of definite integrals have NO elementary antiderivative — ∫e−x2dx\int e^{-x^2}dx, ∫sin⁡xxdx\int \tfrac{\sin x}{x}dx, ∫xa−1ln⁡xdx\int \tfrac{x^a - 1}{\ln x}dx — yet their values over specific intervals are clean: π\sqrt\pi, π2\tfrac\pi2, ln⁡(a+1)\ln(a+1). The tools in this topic never find an antiderivative. They exploit SYMMETRY of the interval, PARAMETERS you can differentiate in, and SUBSTITUTIONS that map an interval onto itself. This is the calculus that competitions (Putnam especially) and physics actually use.

Most integrands have no antiderivative made of familiar functions — e−x2e^{-x^2}, sin⁡xx\tfrac{\sin x}{x}, 1−k2sin⁡2x\sqrt{1 - k^2\sin^2x} — and yet their definite integrals are often exactly computable. The tools are symmetry (reflect the interval onto itself), differentiation under the integral sign (introduce a parameter and differentiate with respect to it), series expansion, and the gamma and beta functions. The skill is choosing the trick that makes the integrand collapse.

Tip
Feynman's trick: differentiate under the integral

Embed the integral in a family I(a)=∫f(x,a) dxI(a) = \int f(x, a)\,dx, compute I′(a)=∫∂af dxI'(a) = \int \partial_a f\,dx (usually elementary), integrate back in aa, and fix the constant from a value of aa where II is known. Example: I(a)=∫01xa−1ln⁡xdxI(a) = \displaystyle\int_0^1\frac{x^a - 1}{\ln x}dx has I′(a)=∫01xadx=1a+1I'(a) = \int_0^1 x^a dx = \tfrac{1}{a+1}, so I(a)=ln⁡(a+1)I(a) = \ln(a+1) (using I(0)=0I(0) = 0). The ln⁡x\ln x that made the integral impossible was erased by one ∂a\partial_a.

Example
Worked: Feynman's trick on the Dirichlet integral

Compute ∫0∞sin⁡xxdx\displaystyle\int_0^\infty\frac{\sin x}{x}dx.

Step 1 — add a damping parameter: I(t)=∫0∞e−txsin⁡xxdxI(t) = \int_0^\infty e^{-tx}\tfrac{\sin x}{x}dx, with I(∞)=0I(\infty) = 0 and the target I(0)I(0).

Step 2 — I′(t)=−∫0∞e−txsin⁡x dx=−11+t2I'(t) = -\int_0^\infty e^{-tx}\sin x\,dx = -\tfrac{1}{1 + t^2} (a Laplace transform).

Step 3 — integrate: I(t)=π2−arctan⁡tI(t) = \tfrac\pi2 - \arctan t (constant from I(∞)=0I(\infty) = 0).

Step 4 — I(0)=π2I(0) = \tfrac\pi2. Every step elementary; the answer famously not.

Side note
Where it goes wrong

Concluding that because ∫e−x2dx\int e^{-x^2}dx has no elementary antiderivative, ∫−∞∞e−x2dx\int_{-\infty}^\infty e^{-x^2}dx cannot be found. The definite integral equals π\sqrt\pi — the absence of an antiderivative says nothing about the number.

King's Rule, Queen's Rule, and Reflection

Tip
King's rule (the reflection substitution)

∫abf(x) dx=∫abf(a+b−x) dx\displaystyle\int_a^b f(x)\,dx = \int_a^b f(a + b - x)\,dx — substituting x→a+b−xx \to a + b - x flips the interval onto itself. Its power: ADD the two forms. For I=∫0π/2sin⁡xsin⁡x+cos⁡xdxI = \int_0^{\pi/2}\tfrac{\sin x}{\sin x + \cos x}dx, the reflection swaps sin⁡\sin and cos⁡\cos, and adding gives 2I=∫0π/21 dx=π22I = \int_0^{\pi/2}1\,dx = \tfrac\pi2, so I=π4I = \tfrac\pi4. A stray factor of xx on [0,π][0, \pi] becomes π−x\pi - x; adding again gives ∫0πx g(sin⁡x)dx=π2∫0πg(sin⁡x)dx\int_0^\pi x\,g(\sin x)dx = \tfrac\pi2\int_0^\pi g(\sin x)dx — how ∫0πxsin⁡x1+cos⁡2xdx=π24\int_0^\pi\tfrac{x\sin x}{1 + \cos^2x}dx = \tfrac{\pi^2}{4} falls out.

Tip
Queen's rule (folding a symmetric interval)

∫02af(x) dx=2∫0af(x) dx\displaystyle\int_0^{2a} f(x)\,dx = 2\int_0^a f(x)\,dx if f(2a−x)=f(x)f(2a - x) = f(x), and =0= 0 if f(2a−x)=−f(x)f(2a - x) = -f(x). Companion (sometimes "Jack's rule"): ∫−aaf=2∫0af\int_{-a}^a f = 2\int_0^a f for even ff, 00 for odd ff. Example: ∫0πsin⁡3x dx=2∫0π/2sin⁡3x dx=2⋅23=43\int_0^\pi\sin^3x\,dx = 2\int_0^{\pi/2}\sin^3x\,dx = 2\cdot\tfrac23 = \tfrac43; and ∫02πcos⁡3x dx=0\int_0^{2\pi}\cos^3x\,dx = 0 by the odd-symmetry about π\pi... check: cos⁡3(2π−x)=cos⁡3x\cos^3(2\pi - x) = \cos^3 x so use the period instead — ∫02πcos⁡3=0\int_0^{2\pi}\cos^3 = 0 because cos⁡3\cos^3 has zero mean over a full period.

Example
Worked: the log-sine integral solves an equation for itself

Find I=∫0π/2ln⁡(sin⁡x)dxI = \int_0^{\pi/2}\ln(\sin x)dx.

Step 1 — King: I=∫0π/2ln⁡(cos⁡x)dxI = \int_0^{\pi/2}\ln(\cos x)dx.

Step 2 — add: 2I=∫0π/2ln⁡(sin⁡xcos⁡x)dx=∫0π/2ln⁡sin⁡2x2dx=∫0π/2ln⁡(sin⁡2x)dx−π2ln⁡22I = \int_0^{\pi/2}\ln(\sin x\cos x)dx = \int_0^{\pi/2}\ln\tfrac{\sin 2x}{2}dx = \int_0^{\pi/2}\ln(\sin 2x)dx - \tfrac\pi2\ln2.

Step 3 — substitute u=2xu = 2x and fold with Queen: 12∫0πln⁡(sin⁡u)du=I\tfrac12\int_0^\pi\ln(\sin u)du = I.

Step 4 — 2I=I−π2ln⁡22I = I - \tfrac\pi2\ln 2, so I=−π2ln⁡2I = -\tfrac\pi2\ln2.

Glasser's Master Theorem and the 1/x Reflection

Tip
Glasser's master theorem

For any integrable ff and constants ai>0a_i > 0, bib_i: ∫−∞∞f ⁣(x−∑iaix−bi)dx=∫−∞∞f(x) dx\displaystyle\int_{-\infty}^\infty f\!\left(x - \sum_i\frac{a_i}{x - b_i}\right)dx = \int_{-\infty}^\infty f(x)\,dx. The simplest case (Cauchy–Schlömilch) is ∫f(x−1x)dx=∫f(x)dx\int f(x - \tfrac1x)dx = \int f(x)dx: the map u=x−1xu = x - \tfrac1x covers every real value once on each half-line, and the two pieces of dudu add up to dxdx. So ∫−∞∞e−(x−1/x)2dx=∫e−x2dx=π\int_{-\infty}^\infty e^{-(x - 1/x)^2}dx = \int e^{-x^2}dx = \sqrt\pi — a hideous integrand, evaluated by recognizing the pattern.

Tip
The x→1/xx \to 1/x reflection on (0,∞)(0, \infty)

On (0,∞)(0, \infty) the substitution x→1xx \to \tfrac1x maps the interval to itself. Two uses: it can show an integral equals its own negative (so it is 00: ∫0∞ln⁡x1+x2dx=0\int_0^\infty\tfrac{\ln x}{1 + x^2}dx = 0), or produce a second form to add: ∫0∞dx1+x4\int_0^\infty\tfrac{dx}{1 + x^4} becomes ∫0∞x2dx1+x4\int_0^\infty\tfrac{x^2dx}{1 + x^4}, and adding, dividing by x2x^2, and substituting u=x−1xu = x - \tfrac1x yields π24\tfrac{\pi\sqrt2}{4}. When the interval is (0,∞)(0, \infty), try this before anything else.

More Named Integrals, With Proofs

Tip
Dirichlet variants and the tangent bridge

∫0∞sin⁡2xx2dx=∫0∞1−cos⁡xx2dx=π2\int_0^\infty\tfrac{\sin^2 x}{x^2}dx = \int_0^\infty\tfrac{1 - \cos x}{x^2}dx = \tfrac\pi2 (one integration by parts each lands on ∫0∞sin⁡xxdx\int_0^\infty\tfrac{\sin x}{x}dx). Substituting x=tan⁡θx = \tan\theta turns ∫0∞ln⁡(1+x2)1+x2dx\int_0^\infty\tfrac{\ln(1+x^2)}{1+x^2}dx into −2∫0π/2ln⁡cos⁡θ dθ=πln⁡2-2\int_0^{\pi/2}\ln\cos\theta\,d\theta = \pi\ln 2; and Feynman with the parameter arctan⁡(ax)\arctan(ax) gives ∫0∞arctan⁡xx(1+x2)dx=π2ln⁡2\int_0^\infty\tfrac{\arctan x}{x(1+x^2)}dx = \tfrac\pi2\ln 2.

Reminder — Substitution and integration by parts:  ∫f(g(x))g′(x) dx=∫f(u) du,∫u dv=uv−∫v du\int f(g(x))g'(x)\,dx=\int f(u)\,du, \qquad \int u\,dv = uv-\int v\,du
Tip
Fresnel, the reflection formula, Wallis

∫0∞sin⁡(x2) dx=12π2\int_0^\infty\sin(x^2)\,dx = \tfrac12\sqrt{\tfrac\pi2} (the Mellin integral ∫0∞ts−1sin⁡t dt=Γ(s)sin⁡πs2\int_0^\infty t^{s-1}\sin t\,dt = \Gamma(s)\sin\tfrac{\pi s}{2} at s=12s = \tfrac12). Γ(s)Γ(1−s)=πsin⁡πs\Gamma(s)\Gamma(1-s) = \tfrac{\pi}{\sin\pi s}, which evaluates ∫0∞dx1+xn=π/nsin⁡(π/n)\int_0^\infty\tfrac{dx}{1+x^n} = \tfrac{\pi/n}{\sin(\pi/n)}. Wallis: ∏n≥14n24n2−1=π2\prod_{n\ge1}\tfrac{4n^2}{4n^2-1} = \tfrac\pi2, from the reduction formula for ∫0π/2sin⁡nx dx\int_0^{\pi/2}\sin^nx\,dx squeezed between consecutive terms. And ∫01ln⁡x1−xdx=−π26\int_0^1\tfrac{\ln x}{1-x}dx = -\tfrac{\pi^2}{6} by expanding 11−x\tfrac{1}{1-x} and integrating termwise.

Example
Proof: ∫0∞sin⁡2xx2dx=π2\int_0^\infty\tfrac{\sin^2 x}{x^2}dx = \tfrac\pi2

Let u=sin⁡2xu = \sin^2x and dv=x−2dxdv = x^{-2}dx, so v=−1xv = -\tfrac1x. The boundary term [−sin⁡2xx]0∞\left[-\tfrac{\sin^2x}{x}\right]_0^\infty vanishes at both ends (near 00, sin⁡2x≈x2\sin^2x \approx x^2; at infinity it is bounded over xx). What remains is ∫0∞2sin⁡xcos⁡xxdx=∫0∞sin⁡2xxdx\int_0^\infty\tfrac{2\sin x\cos x}{x}dx = \int_0^\infty\tfrac{\sin 2x}{x}dx, and the substitution t=2xt = 2x leaves ∫0∞sin⁡ttdt=π2\int_0^\infty\tfrac{\sin t}{t}dt = \tfrac\pi2. ■\blacksquare

Example
Proof: the Wallis product

Let In=∫0π/2sin⁡nx dxI_n = \int_0^{\pi/2}\sin^nx\,dx. Integration by parts gives In=n−1nIn−2I_n = \tfrac{n-1}{n}I_{n-2}, so I2n=(2n−1)!!(2n)!!⋅π2I_{2n} = \tfrac{(2n-1)!!}{(2n)!!}\cdot\tfrac\pi2 and I2n+1=(2n)!!(2n+1)!!I_{2n+1} = \tfrac{(2n)!!}{(2n+1)!!}. Since sin⁡2n+1≤sin⁡2n≤sin⁡2n−1\sin^{2n+1} \le \sin^{2n} \le \sin^{2n-1} on [0,π2][0, \tfrac\pi2], I2n+1≤I2n≤I2n−1I_{2n+1} \le I_{2n} \le I_{2n-1}, and I2n−1I2n+1=2n+12n→1\tfrac{I_{2n-1}}{I_{2n+1}} = \tfrac{2n+1}{2n} \to 1 squeezes I2nI2n+1→1\tfrac{I_{2n}}{I_{2n+1}} \to 1. Writing that ratio out: π2⋅(2n−1)!! (2n+1)!!((2n)!!)2→1\tfrac\pi2\cdot\tfrac{(2n-1)!!\,(2n+1)!!}{((2n)!!)^2} \to 1, which rearranges to ∏k=1n4k24k2−1→π2\prod_{k=1}^n\tfrac{4k^2}{4k^2 - 1} \to \tfrac\pi2. ■\blacksquare

The Named Integrals: Frullani, Beta, Gamma, Weierstrass

Tip
Frullani

∫0∞f(ax)−f(bx)xdx=(f(0)−f(∞))ln⁡ba\displaystyle\int_0^\infty\frac{f(ax) - f(bx)}{x}dx = \big(f(0) - f(\infty)\big)\ln\frac ba. With f=e−tf = e^{-t}: ∫0∞e−x−e−3xxdx=ln⁡3\int_0^\infty\tfrac{e^{-x} - e^{-3x}}{x}dx = \ln 3. Proof idea: write f(ax)−f(bx)x=−∫abf′(tx) dt\tfrac{f(ax) - f(bx)}{x} = -\int_a^b f'(tx)\,dt and swap the order of integration — Feynman's idea once more.

Tip
Beta and Gamma

Γ(n+1)=∫0∞xne−xdx=n!\Gamma(n+1) = \int_0^\infty x^ne^{-x}dx = n! (integrate by parts nn times), and B(m,n)=∫01xm−1(1−x)n−1dx=Γ(m)Γ(n)Γ(m+n)B(m,n) = \int_0^1x^{m-1}(1-x)^{n-1}dx = \tfrac{\Gamma(m)\Gamma(n)}{\Gamma(m+n)}. So ∫01x3(1−x)2dx=3! 2!6!=160\int_0^1x^3(1-x)^2dx = \tfrac{3!\,2!}{6!} = \tfrac1{60} instantly, and ∫0∞x4e−xdx=24\int_0^\infty x^4e^{-x}dx = 24. Also Γ(12)=π\Gamma(\tfrac12) = \sqrt\pi, which is the Gaussian integral wearing a different hat.

Tip
Weierstrass substitution

t=tan⁡x2t = \tan\tfrac x2 turns sin⁡x=2t1+t2\sin x = \tfrac{2t}{1+t^2}, cos⁡x=1−t21+t2\cos x = \tfrac{1-t^2}{1+t^2}, dx=2 dt1+t2dx = \tfrac{2\,dt}{1+t^2}: ANY rational function of sin⁡\sin and cos⁡\cos becomes a rational function of tt, solvable by partial fractions. Example: ∫0πdx2+cos⁡x=∫0∞2 dt3+t2=π3\int_0^\pi\tfrac{dx}{2 + \cos x} = \int_0^\infty\tfrac{2\,dt}{3 + t^2} = \tfrac{\pi}{\sqrt3}.

Example
Worked: series expansion when nothing else fits

Find ∫01ln⁡xln⁡(1−x)dx\int_0^1\ln x\ln(1-x)dx.

Step 1 — expand ln⁡(1−x)=−∑xnn\ln(1 - x) = -\sum\tfrac{x^n}{n}.

Step 2 — swap sum and integral: −∑1n∫01xnln⁡x dx=∑1n(n+1)2-\sum\tfrac1n\int_0^1x^n\ln x\,dx = \sum\tfrac{1}{n(n+1)^2} (the inner integral is −1(n+1)2-\tfrac{1}{(n+1)^2} by parts).

Step 3 — partial fractions 1n−1n+1−1(n+1)2\tfrac1n - \tfrac1{n+1} - \tfrac{1}{(n+1)^2}: telescoping gives 11, the last sums to ζ(2)−1\zeta(2) - 1.

Step 4 — total 2−π262 - \tfrac{\pi^2}{6}. Series turn integrals into sums you already know.

Why It Works

The Gaussian integral I=∫−∞∞e−x2dxI = \int_{-\infty}^\infty e^{-x^2}dx: square it and write the product as a double integral, I2=∬e−(x2+y2) dx dyI^2 = \iint e^{-(x^2 + y^2)}\,dx\,dy over the plane. In polar coordinates x2+y2=r2x^2 + y^2 = r^2 and dx dy=r dr dθdx\,dy = r\,dr\,d\theta, so I2=∫02π∫0∞e−r2r dr dθ=2π⋅12=πI^2 = \int_0^{2\pi}\int_0^\infty e^{-r^2}r\,dr\,d\theta = 2\pi\cdot\tfrac12 = \pi. The extra factor rr from the Jacobian is exactly what makes the inner integral elementary — a one-dimensional problem with no answer becomes a two-dimensional one with an easy one.

Tip
Reading a proof

Do not read a proof the way you read a rule. Cover the last line, ask what the previous line forces, and only then uncover it. If a step feels like magic, that is the step to work by hand with a concrete number.