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 — ex2dx\int e^{-x^2}dx, sinxxdx\int \tfrac{\sin x}{x}dx, xa1lnxdx\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.

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)=afdxI'(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)=01xa1lnxdxI(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 lnx\ln x that made the integral impossible was erased by one a\partial_a.

Example
Worked: Feynman's trick on the Dirichlet integral

Compute 0sinxxdx\displaystyle\int_0^\infty\frac{\sin x}{x}dx.

Step 1 — add a damping parameter: I(t)=0etxsinxxdxI(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)=0etxsinxdx=11+t2I'(t) = -\int_0^\infty e^{-tx}\sin x\,dx = -\tfrac{1}{1 + t^2} (a Laplace transform).

Step 3 — integrate: I(t)=π2arctantI(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.

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

Tip
King's rule (the reflection substitution)

abf(x)dx=abf(a+bx)dx\displaystyle\int_a^b f(x)\,dx = \int_a^b f(a + b - x)\,dx — substituting xa+bxx \to a + b - x flips the interval onto itself. Its power: ADD the two forms. For I=0π/2sinxsinx+cosxdxI = \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π/21dx=π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πxg(sinx)dx=π20πg(sinx)dx\int_0^\pi x\,g(\sin x)dx = \tfrac\pi2\int_0^\pi g(\sin x)dx — how 0πxsinx1+cos2xdx=π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=20af(x)dx\displaystyle\int_0^{2a} f(x)\,dx = 2\int_0^a f(x)\,dx if f(2ax)=f(x)f(2a - x) = f(x), and =0= 0 if f(2ax)=f(x)f(2a - x) = -f(x). Companion (sometimes "Jack's rule"): aaf=20af\int_{-a}^a f = 2\int_0^a f for even ff, 00 for odd ff. Example: 0πsin3xdx=20π/2sin3xdx=223=43\int_0^\pi\sin^3x\,dx = 2\int_0^{\pi/2}\sin^3x\,dx = 2\cdot\tfrac23 = \tfrac43; and 02πcos3xdx=0\int_0^{2\pi}\cos^3x\,dx = 0 by the odd-symmetry about π\pi... check: cos3(2πx)=cos3x\cos^3(2\pi - x) = \cos^3 x so use the period instead — 02πcos3=0\int_0^{2\pi}\cos^3 = 0 because cos3\cos^3 has zero mean over a full period.

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

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

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

Step 2 — add: 2I=0π/2ln(sinxcosx)dx=0π/2lnsin2x2dx=0π/2ln(sin2x)dxπ2ln22I = \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: 120πln(sinu)du=I\tfrac12\int_0^\pi\ln(\sin u)du = I.

Step 4 — 2I=Iπ2ln22I = I - \tfrac\pi2\ln 2, so I=π2ln2I = -\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 ⁣(xiaixbi)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(x1x)dx=f(x)dx\int f(x - \tfrac1x)dx = \int f(x)dx: the map u=x1xu = x - \tfrac1x covers every real value once on each half-line, and the two pieces of dudu add up to dxdx. So e(x1/x)2dx=ex2dx=π\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 x1/xx \to 1/x reflection on (0,)(0, \infty)

On (0,)(0, \infty) the substitution x1xx \to \tfrac1x maps the interval to itself. Two uses: it can show an integral equals its own negative (so it is 00: 0lnx1+x2dx=0\int_0^\infty\tfrac{\ln x}{1 + x^2}dx = 0), or produce a second form to add: 0dx1+x4\int_0^\infty\tfrac{dx}{1 + x^4} becomes 0x2dx1+x4\int_0^\infty\tfrac{x^2dx}{1 + x^4}, and adding, dividing by x2x^2, and substituting u=x1xu = 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

0sin2xx2dx=01cosxx2dx=π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 0sinxxdx\int_0^\infty\tfrac{\sin x}{x}dx). Substituting x=tanθx = \tan\theta turns 0ln(1+x2)1+x2dx\int_0^\infty\tfrac{\ln(1+x^2)}{1+x^2}dx into 20π/2lncosθdθ=πln2-2\int_0^{\pi/2}\ln\cos\theta\,d\theta = \pi\ln 2; and Feynman with the parameter arctan(ax)\arctan(ax) gives 0arctanxx(1+x2)dx=π2ln2\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,udv=uvvdu\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

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

Example
Proof: 0sin2xx2dx=π2\int_0^\infty\tfrac{\sin^2 x}{x^2}dx = \tfrac\pi2

Let u=sin2xu = \sin^2x and dv=x2dxdv = x^{-2}dx, so v=1xv = -\tfrac1x. The boundary term [sin2xx]0\left[-\tfrac{\sin^2x}{x}\right]_0^\infty vanishes at both ends (near 00, sin2xx2\sin^2x \approx x^2; at infinity it is bounded over xx). What remains is 02sinxcosxxdx=0sin2xxdx\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 0sinttdt=π2\int_0^\infty\tfrac{\sin t}{t}dt = \tfrac\pi2. \blacksquare

Example
Proof: the Wallis product

Let In=0π/2sinnxdxI_n = \int_0^{\pi/2}\sin^nx\,dx. Integration by parts gives In=n1nIn2I_n = \tfrac{n-1}{n}I_{n-2}, so I2n=(2n1)!!(2n)!!π2I_{2n} = \tfrac{(2n-1)!!}{(2n)!!}\cdot\tfrac\pi2 and I2n+1=(2n)!!(2n+1)!!I_{2n+1} = \tfrac{(2n)!!}{(2n+1)!!}. Since sin2n+1sin2nsin2n1\sin^{2n+1} \le \sin^{2n} \le \sin^{2n-1} on [0,π2][0, \tfrac\pi2], I2n+1I2nI2n1I_{2n+1} \le I_{2n} \le I_{2n-1}, and I2n1I2n+1=2n+12n1\tfrac{I_{2n-1}}{I_{2n+1}} = \tfrac{2n+1}{2n} \to 1 squeezes I2nI2n+11\tfrac{I_{2n}}{I_{2n+1}} \to 1. Writing that ratio out: π2(2n1)!!(2n+1)!!((2n)!!)21\tfrac\pi2\cdot\tfrac{(2n-1)!!\,(2n+1)!!}{((2n)!!)^2} \to 1, which rearranges to k=1n4k24k21π2\prod_{k=1}^n\tfrac{4k^2}{4k^2 - 1} \to \tfrac\pi2. \blacksquare

The Named Integrals: Frullani, Beta, Gamma, Weierstrass

Tip
Frullani

0f(ax)f(bx)xdx=(f(0)f())lnba\displaystyle\int_0^\infty\frac{f(ax) - f(bx)}{x}dx = \big(f(0) - f(\infty)\big)\ln\frac ba. With f=etf = e^{-t}: 0exe3xxdx=ln3\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)=0xnexdx=n!\Gamma(n+1) = \int_0^\infty x^ne^{-x}dx = n! (integrate by parts nn times), and B(m,n)=01xm1(1x)n1dx=Γ(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(1x)2dx=3!2!6!=160\int_0^1x^3(1-x)^2dx = \tfrac{3!\,2!}{6!} = \tfrac1{60} instantly, and 0x4exdx=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=tanx2t = \tan\tfrac x2 turns sinx=2t1+t2\sin x = \tfrac{2t}{1+t^2}, cosx=1t21+t2\cos x = \tfrac{1-t^2}{1+t^2}, dx=2dt1+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+cosx=02dt3+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 01lnxln(1x)dx\int_0^1\ln x\ln(1-x)dx.

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

Step 2 — swap sum and integral: 1n01xnlnxdx=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 1n1n+11(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.