The classes of trigonometric, inverse and logarithmic integrands that can always be integrated: products of sines and cosines, xncosx, rational functions of cosx and sinx via t=tan21x, and inverse functions by parts.
For rational and algebraical functions Hardy could give systematic theories. Transcendental functions are too varied for that (§143): ∫e−x2dx and ∫(sinx)/xdx, for instance, cannot be expressed by elementary functions at all. What we can do is pick out classes that can always be integrated, and know the method for each. There are four: polynomials in sines and cosines of multiples of x; such polynomials times powers of x; rational functions of cosx and sinx; and integrands built from the inverse functions arcsin, arctan and log. Each class is handled by one of the tools you already have.
The idea
Sines and cosines of multiples (§144). A product such as cos2xcos3x has no standard form, but the product formulas turn it into a sum:
Applying them repeatedly, any product of powers of sines and cosines of multiples of x becomes a sum of single terms αcoskx and βsinkx, each of which integrates at once.
Powers of x times sines and cosines (§145). Integration by parts lowers the power of x by one each time:
Rational functions of cosx and sinx (§146). Here is the substitution that makes them rational: t=tan21x. It is not a trick pulled from a hat. It is the rational parametrisation of the circle from §137, the lines through (−1,0), in disguise.
ExploreWhy t=tan21x rationalises cosx and sinx
Try this.The point P=(cosθ,sinθ) is on the unit circle, and the line from S=(−1,0) through P has slope t. Move t and compare the angle θ at the centre with the angle at S. Where does the line cross the y-axis?
x2+y2=1 cut by the line y=t(x+1)
xy
the conic
fixed point (ξ, η)
line of slope t
the other intersection P(t)
x=1+t21−t2,y=1+t22t. At t=0.6, P=(0.4706,0.8824). The angle at the centre is θ=1.081, the angle at (−1,0) is half of it, and tan21θ=0.6=t.
What to notice
The angle at S is always exactly half the angle at the centre (the inscribed angle theorem), so the slope is t=tan21θ, and the line meets the y-axis at height t. The coordinates of P are the rational functions cosθ=(1−t2)/(1+t2), sinθ=2t/(1+t2) from the conic lesson. As θ→±π, t→±∞.
Inverse functions (§147). To integrate arcsinx, arctanx or logx, integrate by parts with the factor 1: differentiate the inverse function (its derivative is algebraic) and integrate 1 to x. In pictures, the area under the graph of an inverse function is a rectangle minus the area under the graph of the direct function, which is usually easy.
ExploreIntegrating an inverse function
Try this.The curve is v=logu, the inverse of u=ev. The blue area is ∫1blogudu, which we want. The ochre area, to the left of the curve, is ∫0logbevdv=b−1, which is easy. Move b. Then try arcsin and arctan.
∫vdu+∫udv=uv
uv = log u
area below the curve: ∫ v du
area left of the curve: ∫ u dv
rectangle u·v
Blue: ∫1blogudu≈2.545. Ochre: ∫0logbevdv=b−1≈3. Together: 5.545, and the rectangle is blogb−1⋅0=5.545. So ∫1blogudu=blogb−b+1.
What to notice
The blue area is the rectangle blogb minus the ochre area b−1, so ∫1blogudu=blogb−b+1. For any inverse function ϕ of f the same picture gives Hardy’s rule ∫ϕ(y)dy=xf(x)−∫f(x)dx, where y=f(x).
Precise statements
TheoremProducts of sines and cosinesHardy: §144
Any finite sum of terms Acosmaxsinm′axcosnbxsinn′bx⋯, with m,m′,n,n′,… non-negative integers, can be written as a finite sum of terms αcos{(pa+qb+…)x} and βsin{(pa+qb+…)x} with integers p,q,…, and hence integrated.
TheoremPowers of x times trigonometric polynomialsHardy: §145
If n is a positive integer, repeated integration by parts reduces ∫xncosaxdx and ∫xnsinaxdx to ∫cosaxdx or ∫sinaxdx. Consequently ∫P(x,cosax,sinax,cosbx,sinbx,…)dx can be found for any polynomial P.
TheoremRational functions of cosx and sinxHardy: §146
The substitution t=tan21x (for −π<x<π) gives
cosx=1+t21−t2,sinx=1+t22t,dtdx=1+t22,
so the integral of any rational function of cosx and sinx becomes the integral of a rational function of t.
Two integrals worth knowing that come out of this (Hardy’s Ex. LIII. 1): ∫secxdx=log∣secx+tanx∣ and ∫cosecxdx=log∣tan21x∣. Others need no substitution at all: ∫tanxdx=−log∣cosx∣ is the f′/f rule.
More generally, if ϕ is the inverse of f and y=f(x), then ∫ϕ(y)dy=xf(x)−∫f(x)dx.
Integrals ∫P(x,arcsinx)dx and ∫P(x,logx)dx, with P a polynomial, can always be found: the first by putting x=siny, which reduces it to §145, and the second by the reduction formula
On −π<x<π the map x↦tan21x is strictly increasing with inverse x=2arctant, so dx/dt=2/(1+t2), and the substitution can be undone.
Conclude
If R is rational, R(cosx,sinx)dtdx=R(1+t21−t2,1+t22t)1+t22 is a rational function of t; integrate it by §133 and put t=tan21x.
∎
ProofIntegrating an inverse function
Strategy
Substitute y=f(x), then integrate by parts.
Substitute y=f(x)
Then ϕ(y)=x and dy=f′(x)dx, so ∫ϕ(y)dy=∫xf′(x)dx by §136.
Parts
∫xf′(x)dx=xf(x)−∫f(x)dx.
Example: arctan
With f=tan: ∫arctanydy=xtanx−∫tanxdx=xtanx+log∣cosx∣. With y=tanx, ∣x∣<21π: cosx=1/1+y2, so this is yarctany−21log(1+y2), as stated.
∎
Worked examples and exercises
Exercisesin3xcos22x, two ways●●○Hardy: Examples LI, 1
Integrate sin3xcos22x (i) by turning it into a sum of sines of multiples of x, and (ii) by writing it as a polynomial in cosx times sinx and putting cosx=t.
Hint
(i) sin3x=41(3sinx−sin3x) and cos22x=21(1+cos4x). Multiply, and use sinAcosB=21{sin(A+B)+sin(A−B)}.
Hint
(ii) sin2x=1−cos2x and cos2x=2cos2x−1, so the integrand is (1−t2)(2t2−1)2sinx with t=cosx, and dt=−sinxdx.
Solution
(i) sin3xcos22x=81(3sinx−sin3x)(1+cos4x)=161(7sinx−5sin3x+3sin5x−sin7x), using sinxcos4x=21(sin5x−sin3x) and sin3xcos4x=21(sin7x−sinx). So
(ii) Expanding, (1−t2)(2t2−1)2=−4t6+8t4−5t2+1. Since dt=−sinxdx, the integral is −∫(−4t6+8t4−5t2+1)dt=∫(4t6−8t4+5t2−1)dt=74cos7x−58cos5x+35cos3x−cosx.
Hardy says the two answers differ by a constant. Expanding cos3x, cos5x, cos7x as polynomials in cosx shows that here the constant is in fact 0: they are the same function.
ExerciseA closed form for ∫xncosxdx●●○Hardy: Examples LII, 3
Show that ∫xncosxdx=Pncosx+Qnsinx, where Pn=nxn−1−n(n−1)(n−2)xn−3+… and Qn=xn−n(n−1)xn−2+….
Hint
Seek polynomials P,Q with (Pcosx+Qsinx)′=xncosx. Compare the coefficients of cosx and sinx.
Hint
You get P′+Q=xn and Q′−P=0. So Q=xn−P′ and P=Q′.
Solution
(Pcosx+Qsinx)′=(P′+Q)cosx+(Q′−P)sinx. It is enough to have Q′=P and P′+Q=xn, that is Q+Q′′=xn. The polynomial Q=xn−(xn)′′+(xn)′′′′−… works, because adding Q′′ telescopes the series to xn (the series stops, since high derivatives of xn vanish). So
For n=2: Q2=x2−2, P2=2x, which agrees with ∫x2cosx=x2sinx+2xcosx−2sinx from the previous lesson.
Exercise∫secxdx●●○Hardy: Examples LIII, 1
Using t=tan21x, show that ∫secxdx=log1−t1+t for ∣x∣<21π, and that this equals log∣secx+tanx∣.
Hint
secx=(1+t2)/(1−t2), so secxdtdx=1−t22. Use partial fractions.
Hint
For the second form, compute secx+tanx=cosx1+sinx in terms of t.
Solution
1−t22=1−t1+1+t1, which integrates to log∣1+t∣−log∣1−t∣=log1−t1+t. Next, 1+sinx=1+t2(1+t)2 and cosx=1+t2(1−t)(1+t), so secx+tanx=1−t1+t. The two forms are identical.
(If a2<b2, the quadratic (a+b)+(a−b)t2 has real roots and partial fractions give a logarithm instead, as in Hardy’s second form.)
Exercisexnlogx●○○Hardy: §147, Example
Integrate xnlogx for x>0: first for n=−1, then for n=−1.
Hint
For n=−1, parts with F=logx. For n=−1, notice that 1/x is the derivative of logx.
Solution
For n=−1: ∫xnlogxdx=n+1xn+1logx−∫n+1xn+1⋅x1dx=n+1xn+1logx−(n+1)2xn+1.
For n=−1: the integrand is f′f with f=logx, so ∫xlogxdx=21(logx)2 by the chain rule backwards.
Check yourself
Check yourselfChoose one
Which is an integral of sin2x?
Why
sin2x=21(1−cos2x), which integrates to 21x−41sin2x. The first option forgets the chain rule: its derivative is sin2xcosx. The last has the sign of the cos2x term wrong (it integrates cos2x).
Check yourselfEnter a number
Find the increase of ∫arctanxdx from x=0 to x=1, to three decimals. (Check with the second widget, arctan example, b=1.)
Why
xarctanx−21log(1+x2) is 41π−21log2≈0.4388 at x=1 and 0 at x=0.
Check yourselfTrue or false?
The integral of every rational function of cosx and sinx can be expressed by rational functions, logarithms and inverse tangents of tan21x (on an interval where the integrand is defined and ∣x∣<π).
Why
True: t=tan21x turns it into the integral of a rational function of t, and §133 describes what such integrals look like. The obstacle in practice, as before, is factoring the denominator.
Check yourselfChoose one
Which of these integrals is not covered by the four classes of this lesson?
Why
∫x3sin2x is §145, ∫dx/(3+sinx) is §146, and ∫x2arctanx goes by parts to 31x3arctanx−31∫x3/(1+x2), a rational integral. But (sinx)/x is a rational function of xandsinx, not of cosx and sinx alone; its integral is not an elementary function at all.
Hardy’s language
Summary
Summary
Products of sines and cosines of multiples of x: turn products into sums, then integrate term by term.
xn times sine or cosine: integrate by parts n times; each time the power drops by one.
Rational functions of cosx and sinx: t=tan21x makes them rational. It is the circle’s rational parametrisation by lines through (−1,0).
Inverse functions: ∫ϕ(y)dy=xf(x)−∫f(x)dx, the area under an inverse function being a rectangle minus the area under the function. Hence ∫logx=xlogx−x, ∫arctanx, ∫arcsinx.
Many transcendental integrands, such as (sinx)/x, have no elementary integral. That does not mean the integral does not exist.