8.5 Methods of integration
The integrals met so far were either powers of \(x\) or one of the standard results. Most expressions are neither, and three techniques cover the great majority of them.
8.5.1 Integration by substitution
Substitution is the chain rule reversed. It applies when the expression contains some function and that function’s derivative, multiplied together.
Note 8.28. Integrals of the forms \[\int k\left [f(x)\right ]^n f'(x)\,dx\qquad \text {and}\qquad \int k\,\frac {f'(x)}{f(x)}\,dx\] are both handled by substituting \(u=f(x)\). The signal to look for is that one part of the expression is the derivative of another part.
The mechanics are always the same:
- (i).
- let \(u\) be the awkward inner function;
- (ii).
- differentiate to get \(\frac {du}{dx}\), and rearrange for \(dx\);
- (iii).
- substitute so that every \(x\) disappears;
- (iv).
- integrate in \(u\), then replace \(u\) by \(f(x)\) again.
Example 8.29. Integrate (a) \(\displaystyle \int 3x^2\left (x^3-1\right )^4dx\), (b) \(\displaystyle \int \frac {2x+1}{x^2+x+5}\,dx\), (c) \(\displaystyle \int 2xe^{x^2}dx\), (d) \(\displaystyle \int \frac {\sin x}{\cos x}\,dx\), (e) \(\displaystyle \int \frac {x}{\sqrt {x^2+4}}\,dx\).
Solution. (a) The bracket is \(x^3-1\) and its derivative is \(3x^2\), which is sitting right there in front. Let \[u=x^3-1\quad \implies \quad \frac {du}{dx}=3x^2\quad \implies \quad du=3x^2\,dx.\] The whole of \(3x^2\,dx\) is replaced by \(du\) in one step: \[\int 3x^2\left (x^3-1\right )^4dx=\int u^4\,du=\frac {u^5}{5}+c =\frac {\left (x^3-1\right )^5}{5}+c.\]
(b) The derivative of the denominator \(x^2+x+5\) is \(2x+1\), which is exactly the numerator. Let \[u=x^2+x+5\quad \implies \quad du=(2x+1)\,dx.\] \[\int \frac {2x+1}{x^2+x+5}\,dx=\int \frac {1}{u}\,du=\ln |u|+c=\ln \left |x^2+x+5\right |+c.\] Whenever the top is the derivative of the bottom, the answer is the logarithm of the bottom. This is worth recognising on sight.
(c) Let \(u=x^2\), so \(du=2x\,dx\): \[\int 2xe^{x^2}dx=\int e^u\,du=e^u+c=e^{x^2}+c.\]
(d) The derivative of \(\cos x\) is \(-\sin x\), so let \[u=\cos x\quad \implies \quad du=-\sin x\,dx\quad \implies \quad \sin x\,dx=-du.\] \[\int \frac {\sin x}{\cos x}\,dx=\int \frac {-du}{u}=-\ln |u|+c=-\ln |\cos x|+c.\] The minus sign comes from the substitution and must not be dropped. This integral is \(\int \tan x\,dx\) in disguise.
(e) Let \(u=x^2+4\), so \(du=2x\,dx\), which means \(x\,dx=\frac {1}{2}du\): \[\int \frac {x}{\sqrt {x^2+4}}\,dx=\frac {1}{2}\int u^{-\frac {1}{2}}du =\frac {1}{2}\cdot \frac {u^{\frac {1}{2}}}{\frac {1}{2}}+c=\sqrt {u}+c=\sqrt {x^2+4}+c.\]
Note 8.30. The substitution only works if every \(x\) vanishes. If an \(x\) is left stranded after step (iii), either the wrong \(u\) was chosen or the method does not apply — the answer cannot be written down with a mixture of \(u\) and \(x\) in it.
8.5.2 Integration by parts
Substitution deals with a function and its own derivative. Integration by parts deals with a product of two unrelated functions, such as \(x\sin x\) or \(xe^x\).
Note 8.32. The formula comes from the product rule read backwards. Since \[\frac {d}{dx}(uv)=v\frac {du}{dx}+u\frac {dv}{dx},\] rearranging gives \(u\frac {dv}{dx}=\frac {d}{dx}(uv)-v\frac {du}{dx}\), and integrating both sides with respect to \(x\) produces the formula above.
The whole difficulty is choosing which factor is \(u\). The choice must leave the new integral \(\int v\,du\) easier than the one you started with.
Note 8.33. Choosing \(u\). If the product contains an algebraic term (such as \(x\), \(t^2\) or \(3\theta \)), take that as \(u\) — differentiating it lowers the power, and repeating will eventually reduce it to a constant. The exception is when \(\ln x\) appears: then \(\ln x\) is taken as \(u\), because there is no standard integral for it but its derivative \(\frac {1}{x}\) is simple.
Example 8.34. Determine (a) \(\displaystyle \int x\sin x\,dx\), (b) \(\displaystyle \int 2te^{3t}dt\), (c) \(\displaystyle \int x^2e^{x}dx\), (d) \(\displaystyle \int x^2\ln x\,dx\).
Solution. (a) Take the algebraic factor as \(u\): \[u=x,\quad dv=\sin x\,dx\quad \implies \quad du=dx,\quad v=-\cos x.\] \[\int x\sin x\,dx=uv-\int v\,du=-x\cos x-\int (-\cos x)\,dx=-x\cos x+\int \cos x\,dx\] \[=-x\cos x+\sin x+c.\] The new integral \(\int \cos x\,dx\) is standard, which confirms the choice of \(u\) was the right way round. Had we taken \(u=\sin x\), the new integral would have contained \(\frac {x^2}{2}\cos x\) — worse than the original.
(b) Here \(t\) is the algebraic factor: \[u=2t,\quad dv=e^{3t}dt\quad \implies \quad du=2\,dt,\quad v=\frac {1}{3}e^{3t}.\] \[\int 2te^{3t}dt=2t\cdot \frac {1}{3}e^{3t}-\int \frac {1}{3}e^{3t}\cdot 2\,dt =\frac {2}{3}te^{3t}-\frac {2}{3}\int e^{3t}dt\] \[=\frac {2}{3}te^{3t}-\frac {2}{3}\cdot \frac {1}{3}e^{3t}+c =\frac {2}{3}te^{3t}-\frac {2}{9}e^{3t}+c.\] Note the \(\frac {1}{3}\) appearing each time \(e^{3t}\) is integrated; forgetting it is the usual slip.
(c) The algebraic factor is \(x^2\), which needs differentiating twice before it becomes a constant — so the formula is applied twice.
First application: \(u=x^2\), \(dv=e^x dx\), giving \(du=2x\,dx\) and \(v=e^x\): \[\int x^2e^xdx=x^2e^x-\int 2xe^xdx.\]
Second application, on \(\int 2xe^xdx\): now \(u=2x\), \(dv=e^xdx\), giving \(du=2\,dx\) and \(v=e^x\): \[\int 2xe^xdx=2xe^x-\int 2e^xdx=2xe^x-2e^x+c.\]
Combine: \[\int x^2e^xdx=x^2e^x-\left (2xe^x-2e^x\right )+c=e^x\left (x^2-2x+2\right )+c.\] The bracket must be subtracted as a whole; dropping the brackets flips the sign of the last term.
(d) A logarithm is present, so \(\ln x\) takes the role of \(u\) even though \(x^2\) is algebraic: \[u=\ln x,\quad dv=x^2dx\quad \implies \quad du=\frac {1}{x}dx,\quad v=\frac {x^3}{3}.\] \[\int x^2\ln x\,dx=\frac {x^3}{3}\ln x-\int \frac {x^3}{3}\cdot \frac {1}{x}\,dx =\frac {x^3}{3}\ln x-\frac {1}{3}\int x^2dx\] \[=\frac {x^3}{3}\ln x-\frac {x^3}{9}+c.\] The point of choosing \(u=\ln x\) is visible at the middle step: the \(\frac {1}{x}\) cancels against the \(x^3\) and the logarithm disappears from the remaining integral.
8.5.3 Integration using partial fractions
An algebraic fraction whose denominator factorises cannot be integrated as it stands, but splitting it into partial fractions — the technique met earlier with polynomial functions — turns it into a sum of pieces that each integrate to a logarithm or a power.
| Denominator | Form of the partial fractions |
| distinct linear factors, \((x+a)(x-b)\) | \(\frac {A}{x+a}+\frac {B}{x-b}\) |
| repeated linear factor, \((x+a)^3\) | \(\frac {A}{x+a}+\frac {B}{(x+a)^2}+\frac {C}{(x+a)^3}\) |
| quadratic factor, \(\left (x^2+c\right )(x+d)\) | \(\frac {Ax+B}{x^2+c}+\frac {C}{x+d}\) |
Example 8.35. Find (a) \(\displaystyle \int \frac {5x-1}{x^2-x-2}\,dx\), (b) \(\displaystyle \int \frac {3x+1}{(x-1)^3}\,dx\), (c) \(\displaystyle \int \frac {3x^2+4}{x\left (x^2+4\right )}\,dx\), (d) \(\displaystyle \int \frac {x^3+3x^2-2}{x^2+2x}\,dx\).
Solution. (a) Factorise the denominator first: \[x^2-x-2=(x-2)(x+1).\] The factors are distinct and linear, so write \[\frac {5x-1}{(x-2)(x+1)}=\frac {A}{x-2}+\frac {B}{x+1}.\] Multiplying through by \((x-2)(x+1)\): \[5x-1=A(x+1)+B(x-2).\] Choose values of \(x\) that kill one bracket at a time: \[x=2:\quad 9=3A\quad \implies \quad A=3,\] \[x=-1:\quad -6=-3B\quad \implies \quad B=2.\] Now integrate each piece: \[\int \left (\frac {3}{x-2}+\frac {2}{x+1}\right )dx=3\ln |x-2|+2\ln |x+1|+c.\]
(b) The factor is repeated, so three terms are needed. It is quicker here to substitute \(u=x-1\), so \(x=u+1\) and \(dx=du\): \[3x+1=3(u+1)+1=3u+4,\] \[\int \frac {3x+1}{(x-1)^3}dx=\int \frac {3u+4}{u^3}\,du =\int \left (3u^{-2}+4u^{-3}\right )du.\] Splitting the fraction is legitimate because the denominator is a single term. Now integrate: \[=\frac {3u^{-1}}{-1}+\frac {4u^{-2}}{-2}+c=-\frac {3}{u}-\frac {2}{u^2}+c =-\frac {3}{x-1}-\frac {2}{(x-1)^2}+c.\] Note that a repeated factor produces powers, not logarithms — only the \(\frac {1}{u}\) term would have given a logarithm, and here there is none.
(c) The denominator has a quadratic factor, so \[\frac {3x^2+4}{x\left (x^2+4\right )}=\frac {A}{x}+\frac {Bx+C}{x^2+4}.\] Multiplying through by \(x\left (x^2+4\right )\): \[3x^2+4=A\left (x^2+4\right )+(Bx+C)x.\] Putting \(x=0\) gives \(4=4A\), so \(A=1\). Comparing coefficients of \(x^2\): \[3=A+B\quad \implies \quad B=2,\] and comparing coefficients of \(x\) gives \(0=C\). Hence \[\int \left (\frac {1}{x}+\frac {2x}{x^2+4}\right )dx.\] The second piece has a numerator that is the derivative of its denominator, so it integrates to a logarithm directly: \[=\ln |x|+\ln \left (x^2+4\right )+c.\] No modulus is needed on the second logarithm, since \(x^2+4\) is positive for every \(x\).
(d) Here the numerator has degree \(3\) and the denominator degree \(2\). Partial fractions require the top to be of lower degree than the bottom, so divide first: \[\frac {x^3+3x^2-2}{x^2+2x}=x+1+\frac {-2x-2}{x^2+2x}.\] Now split the remainder, with \(x^2+2x=x(x+2)\): \[\frac {-2x-2}{x(x+2)}=\frac {A}{x}+\frac {B}{x+2}\quad \implies \quad -2x-2=A(x+2)+Bx.\] \[x=0:\quad -2=2A\quad \implies \quad A=-1,\] \[x=-2:\quad 2=-2B\quad \implies \quad B=-1.\] So \[\int \frac {x^3+3x^2-2}{x^2+2x}\,dx=\int \left (x+1-\frac {1}{x}-\frac {1}{x+2}\right )dx\] \[=\frac {x^2}{2}+x-\ln |x|-\ln |x+2|+c.\]
Note 8.36. Checking the degrees is the first thing to do, not the last. Attempting partial fractions on a top-heavy fraction leads to equations with no consistent solution, and the wasted work is entirely avoidable.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.