Change of Variables in the Integral

Basis
Last updated: Tags: Calculus, Integration

Suppose you want to compute 012x(x2+1)3dx\int_0^1 2x(x^2+1)^3\,dx. Expanding (x2+1)3(x^2+1)^3 and integrating term by term is possible but tedious. The key observation is that 2x2x is exactly the derivative of x2+1x^2+1, so the integrand has the form f(φ(t))φ(t)f(\varphi(t))\,\varphi'(t) with φ(t)=t2+1\varphi(t) = t^2 + 1 and f(x)=x3f(x) = x^3. The change of variables (or substitution) rule says you can replace the variable of integration to get 12x3dx\int_1^2 x^3\,dx, which is immediate. This checkpoint makes that manoeuvre precise and proves it.

Formal statement

Let φ:[α,β]R\varphi: [\alpha, \beta] \to \mathbb{R} be continuously differentiable (i.e., φC1[α,β]\varphi \in C^1[\alpha,\beta]), with φ([α,β])[a,b]\varphi([\alpha,\beta]) \subseteq [a,b]. Let f:[a,b]Rf: [a,b] \to \mathbb{R} be continuous. Then

αβf(φ(t))φ(t)dt=φ(α)φ(β)f(x)dx.\int_\alpha^\beta f(\varphi(t))\,\varphi'(t)\,dt = \int_{\varphi(\alpha)}^{\varphi(\beta)} f(x)\,dx.

Note that the limits on the right are φ(α)\varphi(\alpha) and φ(β)\varphi(\beta), not necessarily aa and bb; and φ\varphi need not be injective. The only requirements are that φ\varphi maps [α,β][\alpha, \beta] into [a,b][a, b], that φ\varphi is C1C^1, and that ff is continuous.

Proof via the chain rule

Since ff is continuous on [a,b][a, b], by the Newton–Leibniz formula it has a primitive FF satisfying F(x)=f(x)F'(x) = f(x) for all x[a,b]x \in [a, b].

Consider the composite function H(t)F(φ(t))H(t) \coloneqq F(\varphi(t)). By the chain rule,

H(t)=F(φ(t))φ(t)=f(φ(t))φ(t).H'(t) = F'(\varphi(t))\,\varphi'(t) = f(\varphi(t))\,\varphi'(t).

Since φ\varphi is C1C^1 and ff is continuous, the product f(φ(t))φ(t)f(\varphi(t))\,\varphi'(t) is continuous on [α,β][\alpha, \beta], so HH is a primitive of f(φ(t))φ(t)f(\varphi(t))\,\varphi'(t) on [α,β][\alpha, \beta]. Applying Newton–Leibniz to the left-hand side:

αβf(φ(t))φ(t)dt=H(β)H(α)=F(φ(β))F(φ(α)).\int_\alpha^\beta f(\varphi(t))\,\varphi'(t)\,dt = H(\beta) - H(\alpha) = F(\varphi(\beta)) - F(\varphi(\alpha)).

Applying Newton–Leibniz to the right-hand side:

φ(α)φ(β)f(x)dx=F(φ(β))F(φ(α)).\int_{\varphi(\alpha)}^{\varphi(\beta)} f(x)\,dx = F(\varphi(\beta)) - F(\varphi(\alpha)).

The two sides are equal. \square

The proof is strikingly short once you have Newton–Leibniz and the chain rule: the entire content of the substitution rule is just the chain rule applied to a composite involving a primitive.

Indefinite form and the “substitute back” step

For indefinite integrals, the change-of-variables rule takes the form

f(φ(t))φ(t)dt=f(x)dxx=φ(t)=F(φ(t))+C,\int f(\varphi(t))\,\varphi'(t)\,dt = \int f(x)\,dx\bigg|_{x = \varphi(t)} = F(\varphi(t)) + C,

where FF is a primitive of ff. In practice, you perform the substitution x=φ(t)x = \varphi(t), dx=φ(t)dtdx = \varphi'(t)\,dt, evaluate f(x)dx\int f(x)\,dx in the new variable to get F(x)+CF(x) + C, and then substitute back x=φ(t)x = \varphi(t) to express the answer in terms of tt.

For definite integrals you do not need to substitute back, because the limits are transformed directly: t=αt = \alpha gives the lower limit x=φ(α)x = \varphi(\alpha), and t=βt = \beta gives the upper limit x=φ(β)x = \varphi(\beta).

Substitution patterns

Linear substitution

For integrals involving ax+bax + b, set x=φ(t)=at+bx = \varphi(t) = at + b, so φ(t)=a\varphi'(t) = a and dx=adtdx = a\,dt. This gives

f(ax+b)dx=1af(u)duu=ax+b.\int f(ax + b)\,dx = \frac{1}{a}\int f(u)\,du\bigg|_{u = ax+b}.

For example, e2x+3dx=12e2x+3+C\int e^{2x+3}\,dx = \dfrac{1}{2}e^{2x+3} + C.

Trigonometric substitution

When the integrand involves a2x2\sqrt{a^2 - x^2}, set x=asinθx = a\sin\theta (with θ[π/2,π/2]\theta \in [-\pi/2, \pi/2]). Then

a2x2=a2a2sin2θ=acosθ(since cosθ0),\sqrt{a^2 - x^2} = \sqrt{a^2 - a^2\sin^2\theta} = a\cos\theta \quad (\text{since } \cos\theta \geq 0),

and dx=acosθdθdx = a\cos\theta\,d\theta. The radical is eliminated entirely.

Similarly, for a2+x2\sqrt{a^2 + x^2} use x=atanθx = a\tan\theta, and for x2a2\sqrt{x^2 - a^2} use x=a/cosθ=asecθx = a/\cos\theta = a\sec\theta.

Inverse substitution (tt-substitution)

Sometimes it is more natural to let x=φ(t)x = \varphi(t) be an explicit function of a new variable tt — for example, to rationalize an expression or handle a rational integrand. As long as φ\varphi is C1C^1 and the range condition is satisfied, the same formula applies with the roles of the two sides swapped: you compute the integral in tt and substitute back t=φ1(x)t = \varphi^{-1}(x) if needed.

Worked examples

Example 1: 012x(x2+1)3dx\int_0^1 2x(x^2+1)^3\,dx

Set u=x2+1u = x^2 + 1, so du=2xdxdu = 2x\,dx. When x=0x = 0, u=1u = 1; when x=1x = 1, u=2u = 2. The integral transforms to

012x(x2+1)3dx=12u3du=[u44]12=16414=154.\int_0^1 2x(x^2+1)^3\,dx = \int_1^2 u^3\,du = \left[\frac{u^4}{4}\right]_1^2 = \frac{16}{4} - \frac{1}{4} = \frac{15}{4}.

Example 2: 011x2dx\int_0^1 \sqrt{1 - x^2}\,dx

This is the area of a quarter unit circle, which you know to be π/4\pi/4. Let us confirm using trigonometric substitution. Set x=sinθx = \sin\theta, so dx=cosθdθdx = \cos\theta\,d\theta and 1x2=cosθ\sqrt{1-x^2} = \cos\theta. When x=0x = 0, θ=0\theta = 0; when x=1x = 1, θ=π/2\theta = \pi/2. The integral becomes

0π/2cosθcosθdθ=0π/2cos2θdθ.\int_0^{\pi/2} \cos\theta \cdot \cos\theta\,d\theta = \int_0^{\pi/2} \cos^2\theta\,d\theta.

Using the double-angle identity cos2θ=1+cos2θ2\cos^2\theta = \dfrac{1 + \cos 2\theta}{2}:

0π/21+cos2θ2dθ=[θ2+sin2θ4]0π/2=π/22+sinπ40=π4.\int_0^{\pi/2} \frac{1 + \cos 2\theta}{2}\,d\theta = \left[\frac{\theta}{2} + \frac{\sin 2\theta}{4}\right]_0^{\pi/2} = \frac{\pi/2}{2} + \frac{\sin\pi}{4} - 0 = \frac{\pi}{4}.

Example 3: dx1+ex\int \dfrac{dx}{1 + e^x}

Set u=exu = e^x, so du=exdx=udxdu = e^x\,dx = u\,dx, giving dx=duudx = \dfrac{du}{u}. Substituting:

dx1+ex=11+uduu=duu(1+u).\int \frac{dx}{1 + e^x} = \int \frac{1}{1 + u}\cdot\frac{du}{u} = \int \frac{du}{u(1+u)}.

Partial fractions: 1u(1+u)=1u11+u\dfrac{1}{u(1+u)} = \dfrac{1}{u} - \dfrac{1}{1+u}. Integrating:

(1u11+u)du=lnuln(1+u)+C=lnu1+u+C.\int \left(\frac{1}{u} - \frac{1}{1+u}\right)du = \ln u - \ln(1+u) + C = \ln\frac{u}{1+u} + C.

Substituting back u=exu = e^x:

dx1+ex=lnex1+ex+C=xln(1+ex)+C.\int \frac{dx}{1+e^x} = \ln\frac{e^x}{1+e^x} + C = x - \ln(1 + e^x) + C.

(The last equality uses ln(ex)=x\ln(e^x) = x.)

Summary

  • The change-of-variables theorem: if φC1[α,β]\varphi \in C^1[\alpha,\beta] with φ([α,β])[a,b]\varphi([\alpha,\beta]) \subseteq [a,b] and ff is continuous on [a,b][a,b], then αβf(φ(t))φ(t)dt=φ(α)φ(β)f(x)dx\int_\alpha^\beta f(\varphi(t))\,\varphi'(t)\,dt = \int_{\varphi(\alpha)}^{\varphi(\beta)} f(x)\,dx.
  • The proof uses the chain rule to differentiate F(φ(t))F(\varphi(t)), then applies the Newton–Leibniz formula to both sides.
  • For definite integrals, transform the limits directly: t=αx=φ(α)t = \alpha \mapsto x = \varphi(\alpha), t=βx=φ(β)t = \beta \mapsto x = \varphi(\beta); no need to substitute back.
  • For indefinite integrals, after evaluating f(x)dx=F(x)+C\int f(x)\,dx = F(x) + C, substitute back x=φ(t)x = \varphi(t) to express the answer in terms of the original variable.
  • Linear substitution u=ax+bu = ax + b is the simplest case; it introduces a factor of 1/a1/a.
  • Trigonometric substitution x=asinθx = a\sin\theta (or atanθa\tan\theta, asecθa\sec\theta) eliminates square roots of quadratic expressions.
  • Inverse substitution (setting x=φ(t)x = \varphi(t) explicitly) can rationalize complex integrands, such as those involving exe^x via u=exu = e^x.