This note covers the two main techniques for integrating products and composite functions at HL: integration by substitution and integration by parts. You will learn how to choose between them, how to deal with limits in definite integrals, and how to use parts repeatedly. These methods let you integrate functions such as \(x\sqrt{x+3}\), \(x^2e^x\) and \(\ln x\).
Key ideas
Integration by substitution. This reverses the chain rule. Choose a new variable \(u=g(x)\), usually the inside of a bracket, a root or a power, or the denominator. Then:
- Find \(\dfrac{du}{dx}\) and rewrite it as \(du=g'(x)\,dx\).
- Replace every \(x\) and \(dx\) so that only \(u\) and \(du\) remain. If the integrand contains a leftover \(x\), express it in terms of \(u\) by rearranging \(u=g(x)\).
- Integrate with respect to \(u\), then substitute back \(u=g(x)\).
For a definite integral you may change the limits instead: the new limits are the values of \(u\) at the old limits, and you never return to \(x\). If you keep the old limits, you must write them as \(x=\ldots\) or substitute back first.
Integration by parts. This reverses the product rule. Since \(\dfrac{d}{dx}(uv)=u\dfrac{dv}{dx}+v\dfrac{du}{dx}\), integrating gives \[\int u\frac{dv}{dx}\,dx=uv-\int v\frac{du}{dx}\,dx.\] For a definite integral, \(\displaystyle\int_a^bu\frac{dv}{dx}\,dx=\big[uv\big]_a^b-\int_a^bv\frac{du}{dx}\,dx\).
Choosing \(u\) and \(\dfrac{dv}{dx}\). Pick \(u\) to be the part that becomes simpler when differentiated, and \(\dfrac{dv}{dx}\) to be the part you can integrate easily. A common order of preference for \(u\) is: logarithm, then a power of \(x\), then trigonometric or exponential. So for \(x\,e^{x}\) take \(u=x\), and for \(x\ln x\) take \(u=\ln x\).
Repeated parts. For \(x^n\) times an exponential or trigonometric function, apply parts \(n\) times. Each time the power of \(x\) goes down by one.
The "cyclic" case. For integrals such as \(\int e^x\sin x\,dx\), parts applied twice brings back the original integral on the right side. Call the original integral \(I\). Then you have an equation \(I=\ldots-I\), which you solve for \(I\). Keep the same choice of \(u\) (exponential each time, or trig each time) in both steps, otherwise you undo your work.
Integrating \(\ln x\). Write \(\ln x=1\times\ln x\), take \(u=\ln x\) and \(\dfrac{dv}{dx}=1\). Then \(\int\ln x\,dx=x\ln x-\int1\,dx=x\ln x-x+C\).
Using both methods. Some integrals need a substitution first and then parts. For example, in \(\int e^{\sqrt x}\,dx\), let \(u=\sqrt x\), so \(x=u^2\) and \(dx=2u\,du\). The integral becomes \(\int2ue^u\,du\), which is now a job for parts, giving \(2e^u(u-1)+C=2e^{\sqrt x}(\sqrt x-1)+C\).
Checking your answer. Differentiate your result. For substitution you should recover the original integrand. For parts, the product rule should bring back the original product after the extra terms cancel. For a definite integral, a quick numerical check with the integral feature on your GDC is a good safeguard.
Which method? If one factor is (a multiple of) the derivative of the inside of another factor, use substitution. If the integrand is a product of two unrelated types, such as a power and an exponential, use parts. Some integrals need both.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \(u=g(x),\ du=g'(x)\,dx\) | Substitution. Rewrite the whole integral using \(u\). |
| New limits \(g(a)\) and \(g(b)\) | Definite substitution. Then no need to go back to \(x\). |
| \(\displaystyle\int u\,\frac{dv}{dx}\,dx=uv-\int v\,\frac{du}{dx}\,dx\) | Integration by parts for products. |
| \(\displaystyle\int_a^b u\,\frac{dv}{dx}\,dx=\big[uv\big]_a^b-\int_a^b v\,\frac{du}{dx}\,dx\) | Parts for definite integrals. Put the limits on \(uv\) as well. |
| \(\int\ln x\,dx=x\ln x-x+C\) | A standard result found by parts. |
| \(\int e^x\sin x\,dx=\tfrac12e^x(\sin x-\cos x)+C\) | Cyclic case found by two applications of parts. |
Worked examples
Example 1 Use the substitution \(u=x+3\) to evaluate \(\displaystyle\int_1^6x\sqrt{x+3}\,dx\).
\(u=x+3\), so \(du=dx\) and \(x=u-3\).
Limits: \(x=1\) gives \(u=4\), and \(x=6\) gives \(u=9\).
The integral becomes \(\displaystyle\int_4^9(u-3)u^{1/2}\,du=\int_4^9\big(u^{3/2}-3u^{1/2}\big)\,du\).
Integrate: \(\left[\dfrac25u^{5/2}-2u^{3/2}\right]_4^9\).
At \(u=9\): \(\dfrac25(243)-2(27)=97.2-54=43.2\). At \(u=4\): \(\dfrac25(32)-2(8)=12.8-16=-3.2\).
Subtract: \(43.2-(-3.2)=46.4\).
Answer: \(46.4\) (exactly \(\tfrac{232}{5}\)).
Example 2 Find \(\displaystyle\int x^2e^x\,dx\), and hence evaluate \(\displaystyle\int_0^1x^2e^x\,dx\).
First application: \(u=x^2\), \(\dfrac{dv}{dx}=e^x\). So \(\dfrac{du}{dx}=2x\) and \(v=e^x\).
\(\displaystyle\int x^2e^x\,dx=x^2e^x-\int2xe^x\,dx\).
Second application on \(\displaystyle\int2xe^x\,dx\): \(u=2x\), \(\dfrac{dv}{dx}=e^x\), so \(\dfrac{du}{dx}=2\) and \(v=e^x\).
\(\displaystyle\int2xe^x\,dx=2xe^x-\int2e^x\,dx=2xe^x-2e^x\).
Combine: \(\displaystyle\int x^2e^x\,dx=x^2e^x-2xe^x+2e^x+C=e^x(x^2-2x+2)+C\).
Definite integral: at \(x=1\), \(e(1-2+2)=e\). At \(x=0\), \(1\cdot2=2\). So the value is \(e-2=0.718\) (3 s.f.).
Answer: \(e^x(x^2-2x+2)+C\); the definite integral is \(e-2\approx0.718\).
Example 3 Let \(I=\displaystyle\int e^x\sin x\,dx\). Find \(I\).
Take \(u=\sin x\) and \(\dfrac{dv}{dx}=e^x\). Then \(\dfrac{du}{dx}=\cos x\) and \(v=e^x\).
\(I=e^x\sin x-\displaystyle\int e^x\cos x\,dx\).
For the new integral, keep the same pattern: \(u=\cos x\), \(\dfrac{dv}{dx}=e^x\), so \(\dfrac{du}{dx}=-\sin x\) and \(v=e^x\).
\(\displaystyle\int e^x\cos x\,dx=e^x\cos x+\int e^x\sin x\,dx=e^x\cos x+I\).
Substitute: \(I=e^x\sin x-e^x\cos x-I\), so \(2I=e^x(\sin x-\cos x)\).
Answer: \(I=\tfrac12e^x(\sin x-\cos x)+C\). (The constant is added at the end.)
Common errors
- Common error: swapping the roles of \(u\) and \(\dfrac{dv}{dx}\) so that the new integral is harder than the original. If it gets worse, switch them.
- Common error: a sign error in the formula, writing \(uv+\int v\,du\) instead of \(uv-\int v\,du\).
- Common error: in a definite integral by parts, forgetting to apply the limits to the \(uv\) term.
- Common error: changing to \(u\) but keeping the \(x\)-limits, or leaving some \(x\) in the integrand.
- Common error: switching the choice of \(u\) between the two steps of a cyclic integral, which just returns the starting integral.
Exam tip: Write the four items \(u\), \(\dfrac{du}{dx}\), \(\dfrac{dv}{dx}\) and \(v\) in a small grid before you substitute into the parts formula. It prevents slips with signs and missing factors.
Check yourself
- Use \(u=\cos x\) to evaluate \(\displaystyle\int_0^{\pi/2}\sin x\cos^3x\,dx\).
Answer
\(du=-\sin x\,dx\). Limits: \(x=0\to u=1\), \(x=\tfrac\pi2\to u=0\). The integral is \(\int_1^0-u^3\,du=\int_0^1u^3\,du=\tfrac14\). - Find \(\displaystyle\int x\cos x\,dx\).
Answer
Take \(u=x\), \(\frac{dv}{dx}=\cos x\), so \(v=\sin x\). Then \(x\sin x-\int\sin x\,dx=x\sin x+\cos x+C\). - Evaluate \(\displaystyle\int_1^e\ln x\,dx\).
Answer
\([x\ln x-x]_1^e=(e-e)-(0-1)=1\). - Evaluate \(\displaystyle\int_0^1xe^{2x}\,dx\) to 3 s.f.
Answer
Take \(u=x\), \(\frac{dv}{dx}=e^{2x}\), so \(v=\tfrac12e^{2x}\). Then \(\left[\tfrac12xe^{2x}\right]_0^1-\int_0^1\tfrac12e^{2x}\,dx=\tfrac12e^2-\left[\tfrac14e^{2x}\right]_0^1=\tfrac12e^2-\tfrac14e^2+\tfrac14=\tfrac{e^2+1}{4}=2.10\).