Partial fractions reduce every real rational function to pieces we can integrate, and the answer is always a rational function plus logarithms plus inverse tangents, provided we can factor the denominator.
After polynomials come rational functions R(x)=P(x)/Q(x). Here Hardy proves something remarkable: there is a complete method. Every real rational function can be integrated, and the answer is always built from just three kinds of function: rational functions, logarithms and inverse tangents. The method is partial fractions, the same decomposition that made rational functions easy to differentiate in §118. Its one weak point, Hardy notes in §134, is that it needs the roots of the denominator.
The idea
A rational function such as x2−11 has no standard form of its own. But it is the sum of two simple fractions,
x2−11=x−11/2−x+11/2,
and each of those is a standard form: ∫dx/(x−α)=log∣x−α∣. So the plan is: split R into pieces with one factor of the denominator each, integrate each piece, and add.
Why must such a splitting exist? Near each root α of Q, the function R blows up like a multiple of 1/(x−α)p; each piece of the decomposition captures exactly the misbehaviour at one root, and what is left over is a polynomial. The widget lets you see this.
ExploreSplit a rational function into partial fractions
Try this.Step through the method with Next step. Then, with all the pieces switched on, the dashed curve lies on top of R. Switch one piece off at a time and watch where the dashed curve parts company from R. Try the example “a repeated root” and “divide first” too.
R(x)=x2−11
Factor the denominator
x2−1=(x−1)(x+1)
Step 1 of 4
xy
R(x)
sum of the pieces switched on
poles
All pieces are on: their sum is R itself, so the sum of their integrals (right of each arrow) is an integral of R.
What to notice
Switching off a piece with denominator x−α or (x−α)2 spoils the curve near the pole at α and hardly anywhere else: each pole has its own pieces. In “divide first”, switching off the polynomial piece x spoils the curve far away instead: the polynomial part is what R looks like for large ∣x∣. A quadratic factor such as x2+1, with no real root, causes no pole but gives an arctan in the integral.
Precise statements
From §118, every rational function can be written as a polynomial Π(x) plus a finite sum of terms
(x−α)pA,p≥1,
where α runs through the roots of Q(x)=0, possibly complex. The polynomial part is found by long division when degP≥degQ.
The polynomial is integrated by §132, and when p≥2,
∫(x−α)pAdx=−p−1A(x−α)p−11,
which holds whether α is real or complex. The terms with p=1 need a new rule, which is the chain rule read backwards.
With f(x)=x−α and α real, this gives ∫dx/(x−α)=log∣x−α∣. That leaves the terms with p=1 and αcomplex. Here Hardy assumes, as we do from now on, that R has real coefficients. Then complex roots come in conjugate pairs γ±δi, and the corresponding partial fractions have conjugate numerators, so they combine into one real fraction
ax2+2bx+cAx+B,b2<ac.
Completing the square, ax2+2bx+c=a{(x−λ)2+μ2} with λ=−b/a and μ2=(ac−b2)/a2>0. Then we split the numerator as a multiple of the derivative of the denominator plus a constant, and use
The first is the f′/f rule; the second is the standard form ∫dx/(1+u2)=arctanu with u=(x−λ)/μ and the linear change of variable.
TheoremWhat the integral of a rational function looks likeHardy: §133
Let R be a rational function with real coefficients, and suppose the roots of its denominator are known. Then ∫R(x)dx is the sum of a polynomial, finitely many rational functions of the form −p−1A(x−α)p−11 (complex ones occurring in conjugate pairs, whose sums are real), finitely many logarithms and finitely many inverse tangents.
One worked case is worth having as a formula. Put X=ax2+2bx+c, Δ=ac−b2 and D=aB−bA. Then for Δ>0 (no real roots)
∫XAx+Bdx=2aAlog∣X∣+aΔDarctanΔax+b.
Proofs
ProofThe chain rule backwards
Strategy
Differentiate the right-hand side.
Chain rule
By §114, dxdF{f(x)}=F′{f(x)}f′(x), which is the integrand.
The logarithmic case
Take F(u)=log∣u∣, so F′(u)=1/u for u=0. Then dxdlog∣f(x)∣=f′(x)/f(x) wherever f(x)=0.
∎
ProofWhat the integral of a rational function looks like
Strategy
Decompose into partial fractions and show that each kind of term has an integral of one of the listed kinds. The only real work is the pair of terms coming from a pair of conjugate complex roots with p=1.
Polynomial part and the terms with p≥2
The polynomial integrates to a polynomial. A term A/(x−α)p with p≥2 integrates to −A/{(p−1)(x−α)p−1}: differentiate to check. For complex α these occur with their conjugates, and a sum w+wˉ is real.
Terms with p=1 and α real
∫Adx/(x−α)=Alog∣x−α∣, by the chain rule backwards.
Terms with p=1 and α=γ+δi complex
The conjugate term is present too. Adding (λ+μi)/(x−γ−δi) and (λ−μi)/(x−γ+δi) gives the real fraction
(x−γ)2+δ22{λ(x−γ)−μδ}.
Integrate that fraction
Its first part is λ times 2(x−γ)/{(x−γ)2+δ2}, with integral λlog{(x−γ)2+δ2}. Its second part is the constant −2μδ over (x−γ)2+δ2, with integral −2μarctan{(x−γ)/δ}.
Add up
Every piece is a polynomial, a rational function, a logarithm or an inverse tangent, and so is their sum.
∎
The proof is constructive, which is the point: it is also the algorithm. Its first step (§134) is to solve Q(x)=0. For Q(x)=x5+x+3 we cannot do that by a formula, and the method stalls, although the integral certainly exists.
Worked examples and exercises
ExerciseThe quadratic denominator, in general●●○Hardy: Examples XLVIII, 1
With X=ax2+2bx+c, Δ=ac−b2>0 and D=aB−bA, prove that
∫XAx+Bdx=2aAlog∣X∣+aΔDarctanΔax+b.Hint
Write Ax+B=2aA(2ax+2b)+(B−aAb). The first part is a multiple of X′.
Hint
For the rest, aX=(ax+b)2+Δ.
Solution
Since X′=2ax+2b, we have Ax+B=2aAX′+aD. So
∫XAx+Bdx=2aAlog∣X∣+aD∫Xdx.
Now aX=(ax+b)2+Δ, so X1=(ax+b)2+Δa. Put u=ax+b: by the linear change of variable and ∫du/(u2+Δ)=Δ−1/2arctan(u/Δ),
∫Xdx=a1⋅a⋅Δ1arctanΔax+b=Δ1arctanΔax+b.
Multiplying by D/a gives the formula. (For Δ<0 the same split works, but X now factors over the reals and the second integral is a logarithm: Hardy gives 2a−ΔDlogax+b+−Δax+b−−Δ.)
ExerciseDistinct real roots: a formula for the coefficients●●○Hardy: Examples XLVIII, 3
Let the roots of Q(x)=0 be real and distinct, and degP<degQ. Show that
∫Q(x)P(x)dx=α∑Q′(α)P(α)log∣x−α∣,
the sum over the roots α of Q.
Hint
Write P/Q=∑Aα/(x−α). Multiply by x−α and let x→α.
Hint
Q(x)/(x−α)→Q′(α) as x→α, since Q(α)=0.
Solution
Since degP<degQ and the roots are simple, P(x)/Q(x)=∑βAβ/(x−β). Multiply by x−α:
Q(x)(x−α)P(x)=Aα+(x−α)β=α∑x−βAβ.
As x→α the right side tends to Aα. On the left, x−αQ(x)=x−αQ(x)−Q(α)→Q′(α), which is not 0 because α is a simple root. So Aα=P(α)/Q′(α), and integrating each term gives the formula. This is the “cover-up rule” used in the widget: P(α)/Q′(α) is what you get by deleting the factor x−α from Q and putting x=α.
ExerciseThree distinct linear factors●○○Hardy: Examples XLVIII, 6
Integrate (x−a)(x−b)(x−c)x, where a,b,c are distinct.
Hint
Use the previous exercise, or cover up each factor in turn.
Solution
Covering up x−a and putting x=a gives the coefficient (a−b)(a−c)a, and similarly for b and c. So
Check by differentiating: the three derivatives add to −3(x+1)1+6(x2−x+1)2x−1+2{(x−21)2+43}1, which is the decomposition above.
ExerciseHardy’s worked example●●○Hardy: Examples XLVIII, 5
Calculate ∫{(x−1)(x2+1)}2dx. (Choose Hardy’s example in the widget to step through it after trying.)
Hint
The template has four pieces: (x−1)2A+x−1B+(x2+1)2Cx+D+x2+1Ex+F.
Hint
A comes from cover-up at x=1: A=1/(1+1)2. For the others, clear denominators and compare coefficients, or use x=i.
Solution
The decomposition is
4(x−1)21−2(x−1)1+2(x2+1)2x+4(x2+1)2x+1,
which you can confirm by putting it over the common denominator. Integrating term by term (with ∫xdx/(x2+1)2=−1/{2(x2+1)} by the chain rule backwards):
This is Hardy’s answer. Hardy reaches the same decomposition through complex partial fractions with denominators (x∓i) and (x∓i)2; pairing conjugates gives the real form.
Check yourself
Check yourselfChoose one
Which is the correct template for x2(x2+4)x+1?
Why
A repeated factor x2 needs one term for each power, A/x+B/x2; an irreducible quadratic needs a linear numerator Cx+D. The last option factors x2+4 as if it were x2−4. (In fact A=B=41, C=D=−41.)
Check yourselfEnter a number
In (x−2)(x+3)1=x−2A+x+3B, what is A?
Why
Cover up x−2 and put x=2: A=1/(2+3)=51. Similarly B=1/(−3−2)=−51.
Check yourselfTrue or false?
The integral of a rational function is always a rational function.
Why
False. ∫dx/x=log∣x∣ and ∫dx/(1+x2)=arctanx are not rational, and §131 showed 1/x is not the derivative of any rational function. The integral is rational exactly when no terms with p=1 survive in the partial fractions.
Check yourselfChoose one
∫x3+x+53x2+1dx=
Why
The numerator is exactly the derivative of the denominator, so the f′/f rule applies directly, with no need for the roots. Hardy’s warning in §134 is about the general method; look for f′/f before reaching for partial fractions.
Hardy’s language
In more complicated cases the labour involved is sometimes prohibitive, and other devices have to be used.
— G. H. Hardy, §134
Summary
Summary
Divide first if the numerator has degree at least that of the denominator; then split the proper part into partial fractions.
∫A/(x−α)p is −A/{(p−1)(x−α)p−1} for p≥2 and Alog∣x−α∣ for p=1.
An irreducible quadratic factor gives a fraction (Ax+B)/(ax2+2bx+c): split off a multiple of the derivative (a log) and complete the square (an arctan).
The chain rule backwards, ∫F′(f)f′=F(f), and its special case ∫f′/f=log∣f∣ are worth looking for first.
The integral of a real rational function is always polynomial + rational + logs + arctans; the obstacle in practice is finding the roots of the denominator.