Chapter VII · Additional theorems in the differential and integral calculus

Integration by parts and by substitution

§166 40 min

The two great transformation rules for definite integrals, why substitution works strip by strip, and how they evaluate integrals whose antiderivatives we never find.

Why this matters

Chapter VI met integration by parts (§141) and substitution (§136) as rules for finding antiderivatives. §166 restates them for definite integrals, where they become more powerful: a definite integral depends only on the difference F(b)−F(a)F(b) - F(a), and this difference can often be found by a device even when FF itself cannot be written down. The reduction formulae for ∫0π/2sin⁡nx dx\int_0^{\pi/2}\sin^n x\,dx, the Beta integral ∫01xm(1−x)n dx\int_0^1 x^m(1-x)^n\,dx, and the next lesson’s proof of Taylor’s theorem are all integration by parts, used on definite integrals.

The idea

Substitution is a change of scale on the axis. Put t=ϕ(x)t = \phi(x). A short piece of the xx-axis, of length Δx\Delta x, is carried to a piece of the tt-axis of length about ϕ′(x)Δx\phi'(x)\Delta x: the derivative is the local stretching factor. So a strip of height f(t)f(t) over that tt-piece has nearly the same area as a strip of height f{ϕ(x)}ϕ′(x)f\{\phi(x)\}\phi'(x) over the xx-piece. Adding up strips, ∫f(t) dt\int f(t)\,dt over the image interval equals ∫f{ϕ(x)}ϕ′(x) dx\int f\{\phi(x)\}\phi'(x)\,dx.

Explore Substitution strip by strip

Try this. Highlight one strip and compare its width on the two axes, and the stretch factor Δt/Δx\Delta t/\Delta x with the values of ϕ′\phi' at the ends of the strip. Double nn a few times and watch the two sums. Then choose the third example, where t=sin⁡xt = \sin x runs up and back down again.

∫01.52xcos⁡x2 dx\int_{0}^{1.5} 2x\cos x^2\,dx, with t=ϕ(x)=x2t = \phi(x) = x^2
x
∫02.25cos⁡t dt\int_{0}^{2.25} \cos t\,dt: the same strips, carried to the tt-axis
t
  • top: y = f(φ(x)) φ′(x); bottom: y = f(t)
  • the highlighted strip, in both pictures
  • counted negatively (below the axis, or t running backwards)
Example
Strip 3: width Δx=0.25\Delta x = 0.25 becomes Δt=0.3125\Delta t = 0.3125; the stretch factor is Δt/Δx=1.25\Delta t/\Delta x = 1.25, which by the mean value theorem is the value of ϕ′\phi' at some point of the strip; at its ends ϕ′\phi' is 11 and 1.51.5.
Sum on top 0.9595420.959542, sum below 1.232131.23213, difference −0.273-0.273; both tend to 0.7780730.778073.
What to notice

Each strip of the xx-integral corresponds to one strip of the tt-integral, and the factor ϕ′(x)\phi'(x) in the integrand exactly compensates for the stretching. The two sums differ only because Δt\Delta t is not exactly ϕ′(xk)Δx\phi'(x_k)\Delta x, and that difference shrinks as the strips narrow. In the third example the strips go out to t=1t = 1 and come back, counting negatively on the way back, so the tt-integral is over [0,0][0, 0] and the answer is 00: substitution does not need ϕ\phi to be monotonic.

Integration by parts is the product rule read backwards. Since (fϕ)′=f′ϕ+fϕ′(f\phi)' = f'\phi + f\phi', integrating from aa to bb gives f(b)ϕ(b)−f(a)ϕ(a)=∫f′ϕ+∫fϕ′f(b)\phi(b) - f(a)\phi(a) = \int f'\phi + \int f\phi'. It trades the integral of fϕ′f\phi' for the integral of f′ϕf'\phi, which is useful when differentiating ff simplifies it (a polynomial loses a degree, arctan⁡x\arctan x becomes rational) and integrating ϕ′\phi' does not complicate it.

Precise statements

Theorem Integration by parts Hardy: §166

If f′f' and ϕ′\phi' are continuous on [a,b][a, b], then

∫abf(x) ϕ′(x) dx=f(b)ϕ(b)−f(a)ϕ(a)−∫abf′(x) ϕ(x) dx.\int_a^b f(x)\,\phi'(x)\,dx = f(b)\phi(b) - f(a)\phi(a) - \int_a^b f'(x)\,\phi(x)\,dx .

The bracket is usually written [fϕ]ab\big[f\phi\big]_a^b.

Theorem Substitution Hardy: §166

Let ϕ′\phi' be continuous on [a,b][a, b], let ff be continuous on an interval containing all the values of ϕ\phi on [a,b][a, b], and let c=ϕ(a)c = \phi(a), d=ϕ(b)d = \phi(b). Then

∫cdf(t) dt=∫abf{ϕ(x)} ϕ′(x) dx.\int_c^d f(t)\,dt = \int_a^b f\{\phi(x)\}\,\phi'(x)\,dx .

Nothing requires ϕ\phi to be increasing, or one-to-one; and if c>dc > d the left side is read with the convention ∫cd=−∫dc\int_c^d = -\int_d^c of §165.

Proofs

Both proofs are the same short argument: identify the integrand as the derivative of a known function, and apply ∫abF′=F(b)−F(a)\int_a^b F' = F(b) - F(a) (the fundamental theorem, General properties of the definite integral).

Proof Integration by parts
Strategy

The product fϕf\phi has derivative f′ϕ+fϕ′f'\phi + f\phi'; integrate this from aa to bb.

Differentiate the product

(fϕ)′=f′ϕ+fϕ′(f\phi)' = f'\phi + f\phi', and both terms are continuous because ff, f′f', ϕ\phi, ϕ′\phi' are.

Integrate

fϕf\phi is an antiderivative of the continuous function f′ϕ+fϕ′f'\phi + f\phi', so ∫ab(f′ϕ+fϕ′)=f(b)ϕ(b)−f(a)ϕ(a)\int_a^b (f'\phi + f\phi') = f(b)\phi(b) - f(a)\phi(a).

Split and rearrange

By (5) of §165 the left side is ∫abf′ϕ+∫abfϕ′\int_a^b f'\phi + \int_a^b f\phi'. Move the first term across.

Proof Substitution
Strategy

Let FF be an antiderivative of ff, which exists because ff is continuous (§165, (10)). By the chain rule, F{ϕ(x)}F\{\phi(x)\} is an antiderivative of f{ϕ(x)}ϕ′(x)f\{\phi(x)\}\phi'(x). Both sides of the formula are then the same difference of values of FF.

An antiderivative of ff

Let F(t)=∫ctf(u) duF(t) = \int_c^t f(u)\,du; then F′=fF' = f on the interval where ff is continuous.

Chain rule

ddxF{ϕ(x)}=F′{ϕ(x)} ϕ′(x)=f{ϕ(x)} ϕ′(x)\dfrac{d}{dx}F\{\phi(x)\} = F'\{\phi(x)\}\,\phi'(x) = f\{\phi(x)\}\,\phi'(x), which is continuous on [a,b][a, b].

Evaluate both sides

The right side is F{ϕ(b)}−F{ϕ(a)}=F(d)−F(c)F\{\phi(b)\} - F\{\phi(a)\} = F(d) - F(c), and the left side is also F(d)−F(c)F(d) - F(c). Notice that we never needed ϕ\phi to be one-to-one: only the end values ϕ(a)\phi(a), ϕ(b)\phi(b) enter.

Worked examples and exercises

Exercise ●○○ Hardy: Examples LXVI, 3

Prove that ∫01arcsin⁡x dx=12π−1\int_0^1 \arcsin x\,dx = \tfrac12\pi - 1 and ∫01xarctan⁡x dx=14π−12\int_0^1 x\arctan x\,dx = \tfrac14\pi - \tfrac12.

Hint
For the first take f=arcsin⁡xf = \arcsin x, ϕ′=1\phi' = 1. For the second take f=arctan⁡xf = \arctan x, ϕ′=x\phi' = x, ϕ=12x2\phi = \tfrac12 x^2.
Hint
x21+x2=1−11+x2\dfrac{x^2}{1+x^2} = 1 - \dfrac{1}{1+x^2}.

Solution

First. Strictly, arcsin⁡\arcsin has no continuous derivative at x=1x = 1, so integrate over [0,X][0, X] with X<1X < 1 and let X→1X \to 1 at the end (the integrand is continuous on [0,1][0, 1], so the integral over [0,X][0, X] tends to the integral over [0,1][0, 1]). Parts gives

∫0Xarcsin⁡x dx=Xarcsin⁡X−∫0Xx1−x2 dx=Xarcsin⁡X+1−X2−1→12π−1.\int_0^X \arcsin x\,dx = X\arcsin X - \int_0^X \frac{x}{\sqrt{1-x^2}}\,dx = X\arcsin X + \sqrt{1-X^2} - 1 \to \tfrac12\pi - 1 .

Second.

∫01xarctan⁡x dx=[12x2arctan⁡x]01−12∫01x21+x2 dx=π8−12(1−π4)=π4−12.\int_0^1 x\arctan x\,dx = \Big[\tfrac12 x^2\arctan x\Big]_0^1 - \frac12\int_0^1\frac{x^2}{1+x^2}\,dx = \frac{\pi}{8} - \frac12\Big(1 - \frac\pi4\Big) = \frac\pi4 - \frac12 .
Exercise Wallis’s integrals ●●○ Hardy: Examples LXVI, 9–10

Let un=∫0π/2sin⁡nx dxu_n = \int_0^{\pi/2}\sin^n x\,dx. Prove that un=n−1nun−2u_n = \dfrac{n-1}{n}u_{n-2} for n≥2n \ge 2, and deduce that

un=2⋅4⋅6⋯(n−1)3⋅5⋅7⋯n (n odd),un=π2⋅1⋅3⋅5⋯(n−1)2⋅4⋅6⋯n (n even).u_n = \frac{2\cdot4\cdot6\cdots(n-1)}{3\cdot5\cdot7\cdots n} \ (n \text{ odd}), \qquad u_n = \frac\pi2\cdot\frac{1\cdot3\cdot5\cdots(n-1)}{2\cdot4\cdot6\cdots n} \ (n \text{ even}).
Hint
Write sin⁡nx=sin⁡n−1x⋅sin⁡x\sin^n x = \sin^{n-1}x\cdot\sin x and integrate by parts with f=sin⁡n−1xf = \sin^{n-1}x, ϕ=−cos⁡x\phi = -\cos x.
Hint
You will meet cos⁡2x\cos^2 x; replace it by 1−sin⁡2x1 - \sin^2 x and solve for unu_n.
Solution

With f=sin⁡n−1xf = \sin^{n-1}x and ϕ=−cos⁡x\phi = -\cos x (so ϕ′=sin⁡x\phi' = \sin x):

un=[−sin⁡n−1xcos⁡x]0π/2+(n−1)∫0π/2sin⁡n−2xcos⁡2x dx.u_n = \Big[-\sin^{n-1}x\cos x\Big]_0^{\pi/2} + (n-1)\int_0^{\pi/2}\sin^{n-2}x\cos^2 x\,dx .

The bracket vanishes at both ends (for n≥2n \ge 2). Writing cos⁡2x=1−sin⁡2x\cos^2 x = 1 - \sin^2 x, the integral is un−2−unu_{n-2} - u_n, so un=(n−1)(un−2−un)u_n = (n-1)(u_{n-2} - u_n), that is, nun=(n−1)un−2n u_n = (n-1)u_{n-2}.

Now u0=12πu_0 = \tfrac12\pi and u1=∫0π/2sin⁡x dx=1u_1 = \int_0^{\pi/2}\sin x\,dx = 1. Applying the recurrence repeatedly: for odd nn, un=n−1n⋅n−3n−2⋯23⋅u1u_n = \frac{n-1}{n}\cdot\frac{n-3}{n-2}\cdots\frac{2}{3}\cdot u_1; for even nn, un=n−1n⋅n−3n−2⋯12⋅u0u_n = \frac{n-1}{n}\cdot\frac{n-3}{n-2}\cdots\frac12\cdot u_0. These are the stated formulae. For example u4=34⋅12⋅π2=3π16u_4 = \tfrac34\cdot\tfrac12\cdot\tfrac\pi2 = \tfrac{3\pi}{16} and u5=45⋅23=815u_5 = \tfrac45\cdot\tfrac23 = \tfrac{8}{15}.

Exercise The Beta integral ●●○ Hardy: Examples LXVI, 7

Let um,n=∫01xm(1−x)n dxu_{m,n} = \int_0^1 x^m(1-x)^n\,dx for non-negative integers mm, nn. Prove by parts that (m+n+1)um,n=n um,n−1(m+n+1)u_{m,n} = n\,u_{m,n-1} for n≥1n \ge 1, and deduce that um,n=m! n!(m+n+1)!u_{m,n} = \dfrac{m!\,n!}{(m+n+1)!}.

Hint
Integrate xmx^m and differentiate (1−x)n(1-x)^n. Then write xm+1=xm−xm(1−x)x^{m+1} = x^m - x^m(1-x).

Solution

With ϕ′=xm\phi' = x^m, ϕ=xm+1/(m+1)\phi = x^{m+1}/(m+1) and f=(1−x)nf = (1-x)^n:

um,n=[xm+1(1−x)nm+1]01+nm+1∫01xm+1(1−x)n−1 dx.u_{m,n} = \Big[\frac{x^{m+1}(1-x)^n}{m+1}\Big]_0^1 + \frac{n}{m+1}\int_0^1 x^{m+1}(1-x)^{n-1}\,dx .

The bracket is 00 for n≥1n \ge 1. Since xm+1=xm−xm(1−x)x^{m+1} = x^m - x^m(1-x), the last integral is um,n−1−um,nu_{m,n-1} - u_{m,n}. So (m+1)um,n=n um,n−1−n um,n(m+1)u_{m,n} = n\,u_{m,n-1} - n\,u_{m,n}, that is, (m+n+1)um,n=n um,n−1(m+n+1)u_{m,n} = n\,u_{m,n-1}.

Repeating, um,n=nm+n+1⋅n−1m+n⋯1m+2⋅um,0u_{m,n} = \frac{n}{m+n+1}\cdot\frac{n-1}{m+n}\cdots\frac{1}{m+2}\cdot u_{m,0}, and um,0=1m+1u_{m,0} = \frac{1}{m+1}. The product is n!(m+n+1)(m+n)⋯(m+1)=m! n!(m+n+1)!\dfrac{n!}{(m+n+1)(m+n)\cdots(m+1)} = \dfrac{m!\,n!}{(m+n+1)!}. Check: u1,1=∫01x(1−x) dx=16=1! 1!3!u_{1,1} = \int_0^1 x(1-x)\,dx = \tfrac16 = \tfrac{1!\,1!}{3!}.

Exercise A substitution that reflects the range ●●○ Hardy: Examples LXVI, 16–17

Using x=π−yx = \pi - y, prove that ∫0πx ϕ(sin⁡x) dx=12π∫0πϕ(sin⁡x) dx\int_0^\pi x\,\phi(\sin x)\,dx = \tfrac12\pi\int_0^\pi\phi(\sin x)\,dx for continuous ϕ\phi, and hence that ∫0πxsin⁡x1+cos⁡2x dx=14π2\displaystyle\int_0^\pi\frac{x\sin x}{1+\cos^2 x}\,dx = \tfrac14\pi^2.

Hint
Under x=π−yx = \pi - y, sin⁡x=sin⁡y\sin x = \sin y, dx=−dydx = -dy, and the limits 0,π0, \pi become π,0\pi, 0.
Hint
For the integral, ϕ(s)=s/(2−s2)\phi(s) = s/(2 - s^2) works, since 1+cos⁡2x=2−sin⁡2x1 + \cos^2 x = 2 - \sin^2 x. Then substitute t=cos⁡xt = \cos x.

Solution

Call the integral II. The substitution x=π−yx = \pi - y gives

I=∫π0(π−y) ϕ(sin⁡y) (−dy)=∫0π(π−y) ϕ(sin⁡y) dy=π∫0πϕ(sin⁡y) dy−I,I = \int_\pi^0 (\pi - y)\,\phi(\sin y)\,(-dy) = \int_0^\pi(\pi - y)\,\phi(\sin y)\,dy = \pi\int_0^\pi\phi(\sin y)\,dy - I,

so 2I=π∫0πϕ(sin⁡x) dx2I = \pi\int_0^\pi\phi(\sin x)\,dx. The integrand xsin⁡x/(1+cos⁡2x)x\sin x/(1+\cos^2 x) is of this form, so

∫0πxsin⁡x1+cos⁡2x dx=π2∫0πsin⁡x1+cos⁡2x dx=π2∫−11dt1+t2=π2(π4+π4)=π24,\int_0^\pi\frac{x\sin x}{1+\cos^2 x}\,dx = \frac\pi2\int_0^\pi\frac{\sin x}{1+\cos^2 x}\,dx = \frac\pi2\int_{-1}^{1}\frac{dt}{1+t^2} = \frac\pi2\Big(\frac\pi4 + \frac\pi4\Big) = \frac{\pi^2}{4},

where t=cos⁡xt = \cos x, dt=−sin⁡x dxdt = -\sin x\,dx carries [0,π][0, \pi] to [1,−1][1, -1]. The integrand xsin⁡x/(1+cos⁡2x)x\sin x/(1+\cos^2 x) has no elementary antiderivative that one would find easily; the symmetry did the work, which is exactly Hardy’s point about definite integrals.

Exercise Repeated integrals as one integral ●●● Hardy: Examples LXVI, 6

Let ff be continuous, f1(x)=∫0xf(t) dtf_1(x) = \int_0^x f(t)\,dt, and fk(x)=∫0xfk−1(t) dtf_k(x) = \int_0^x f_{k-1}(t)\,dt for k≥2k \ge 2. Prove that

fk(x)=1(k−1)!∫0xf(t) (x−t)k−1 dt.f_k(x) = \frac{1}{(k-1)!}\int_0^x f(t)\,(x - t)^{k-1}\,dt .
Hint
By the fundamental theorem, fj′=fj−1f_j' = f_{j-1} (with f0=ff_0 = f), and every fjf_j with j≥1j \ge 1 vanishes at 00.
Hint
Fix xx. In fk(x)=∫0xfk−1(s)⋅1 dsf_k(x) = \int_0^x f_{k-1}(s)\cdot 1\,ds integrate by parts with ϕ(s)=−(x−s)\phi(s) = -(x - s), so that ϕ′=1\phi' = 1; then do it again with ϕ(s)=−(x−s)2/2\phi(s) = -(x-s)^2/2, and so on.
Solution

Fix xx and regard ss as the variable. For j=1,2,…,k−1j = 1, 2, \dots, k-1, integrate by parts with ϕ(s)=−(x−s)j/j!\phi(s) = -(x-s)^{j}/j!, whose derivative is (x−s)j−1/(j−1)!(x-s)^{j-1}/(j-1)!:

∫0xfk−j(s) (x−s)j−1(j−1)! ds=[−fk−j(s) (x−s)jj!]0x+∫0xfk−j−1(s) (x−s)jj! ds.\int_0^x f_{k-j}(s)\,\frac{(x-s)^{j-1}}{(j-1)!}\,ds = \Big[-f_{k-j}(s)\,\frac{(x-s)^{j}}{j!}\Big]_0^x + \int_0^x f_{k-j-1}(s)\,\frac{(x-s)^{j}}{j!}\,ds .

The bracket vanishes at s=xs = x because of the factor (x−x)j(x - x)^j, and at s=0s = 0 because fk−j(0)=0f_{k-j}(0) = 0 (here k−j≥1k - j \ge 1). So each step lowers the index of ff by one and raises the power of (x−s)(x - s) by one, without changing the value. Starting from fk(x)=∫0xfk−1(s) dsf_k(x) = \int_0^x f_{k-1}(s)\,ds (the case j=1j = 1) and applying the step for j=1,…,k−1j = 1, \dots, k-1, we arrive at

fk(x)=∫0xf0(s) (x−s)k−1(k−1)! ds=1(k−1)!∫0xf(t) (x−t)k−1 dt.f_k(x) = \int_0^x f_0(s)\,\frac{(x-s)^{k-1}}{(k-1)!}\,ds = \frac{1}{(k-1)!}\int_0^x f(t)\,(x - t)^{k-1}\,dt .

All the integrands are continuous and the ϕ\phi’s have continuous derivatives, so parts applies at every step. This is often called Cauchy’s formula for repeated integration. Applied to f=g(k)f = g^{(k)} it is Taylor’s theorem with the integral remainder, the subject of the next lesson.

Check yourself

Check yourself Choose one

To evaluate ∫02x ex2 dx\int_0^2 x\,e^{x^2}\,dx by the substitution t=x2t = x^2, which integral do you get?

Why

dt=2x dxdt = 2x\,dx, so x dx=12dtx\,dx = \tfrac12 dt, and the limits change with the variable: x=0↦t=0x = 0 \mapsto t = 0, x=2↦t=4x = 2 \mapsto t = 4. The answer is 12(e4−1)\tfrac12(e^4 - 1). Keeping the old limits (first option) is the commonest mistake with definite substitutions.

Check yourself True or false?

The substitution rule for definite integrals is valid only when ϕ\phi is increasing (or decreasing) on [a,b][a, b].

Why

False. The proof uses only the chain rule and the end values ϕ(a)\phi(a), ϕ(b)\phi(b). In the widget’s third example, t=sin⁡xt = \sin x on [0,π][0, \pi] goes up and comes back; both sides are 00. Monotonicity is needed for the other direction of use, x=ψ(t)x = \psi(t) with ψ\psi an inverse, where we must be able to solve for xx.

Check yourself Enter a number

Using un=n−1nun−2u_n = \frac{n-1}{n}u_{n-2} and u1=1u_1 = 1, find u5=∫0π/2sin⁡5x dxu_5 = \int_0^{\pi/2}\sin^5 x\,dx.

Why

u3=23u1=23u_3 = \tfrac23 u_1 = \tfrac23, then u5=45u3=815≈0.5333u_5 = \tfrac45 u_3 = \tfrac{8}{15} \approx 0.5333.

Check yourself Choose one

To evaluate ∫01x2ex dx\int_0^1 x^2 e^x\,dx by parts, which choice reduces the problem?

Why

Differentiating x2x^2 lowers the degree and integrating exe^x leaves it unchanged, so two steps leave ∫ex\int e^x: the integral is [(x2−2x+2)ex]01=e−2\big[(x^2 - 2x + 2)e^x\big]_0^1 = e - 2. The second choice raises the power of xx and makes things worse. Any product can be split as fϕ′f\phi' (take ϕ\phi an antiderivative of one factor).

Hardy’s language

Summary

Summary
  • Parts: ∫abfϕ′=[fϕ]ab−∫abf′ϕ\int_a^b f\phi' = [f\phi]_a^b - \int_a^b f'\phi, for continuous f′f' and ϕ′\phi'; it is the product rule integrated.
  • Substitution: ∫ϕ(a)ϕ(b)f(t) dt=∫abf{ϕ(x)}ϕ′(x) dx\int_{\phi(a)}^{\phi(b)} f(t)\,dt = \int_a^b f\{\phi(x)\}\phi'(x)\,dx; ϕ′\phi' is the local stretching factor, and ϕ\phi need not be monotonic.
  • Change the limits along with the variable, and keep the signs given by the convention ∫cd=−∫dc\int_c^d = -\int_d^c.
  • Symmetry substitutions and reduction formulae evaluate definite integrals whose antiderivatives are unknown or useless.