---
title: Strategy for integration
heading: Which technique, and how to tell at a glance
eyebrow: A6 · Lesson 5 · Strategy for integration
xp: 50
---

::: hook
You now have four techniques: substitution, parts, trigonometric identities and substitutions, and partial fractions. On a real integral nobody tells you which one applies. Engineers develop a quick scan: look at the integrand's shape, try the cheapest method that could work, and check by differentiating. This lesson is that scan, practiced on mixed integrals.
:::

::: play
- The curve is an integrand from a list, with its antiderivative dashed. Pick an integral with the slider.
- For each one, decide the method before you look at the readout: substitution, parts, trig identity or partial fractions.
- Check: the dashed curve's slope should match the solid curve's height everywhere.
:::

```sim plot
view: graph
x: x = 0.1..3
y: y = auto
slider: k = 1..4 step 1 = 1
plot: step(1.5 - k)*x/(x^2 + 4) + step(k - 1.5)*step(2.5 - k)*x*exp(x) + step(k - 2.5)*step(3.5 - k)*sin(x)^3 + step(k - 3.5)/(x*(x + 1)) | samples: 400 | label: integrand
plot: step(1.5 - k)*0.5*ln(x^2 + 4) + step(k - 1.5)*step(2.5 - k)*(x - 1)*exp(x) + step(k - 2.5)*step(3.5 - k)*(cos(x)^3/3 - cos(x)) + step(k - 3.5)*(ln(x) - ln(x + 1)) | samples: 400 | dashed | color: ch2 | label: antiderivative
```

::: predict
## Which method fits $\displaystyle\int\frac{x}{x^2 + 4}\,dx$ best?

- [x] Substitution, with $u = x^2 + 4$
- [ ] Integration by parts
- [ ] Partial fractions
- [ ] The substitution $x = 2\tan\theta$

::: reveal
Substitution. The numerator, $x\,dx$, is half the derivative of the denominator, so $u = x^2 + 4$ turns it into $\frac12\int\frac{du}{u} = \frac12\ln(x^2 + 4)$. The trig substitution would also work, but it takes four lines for what substitution does in one. Spotting a function next to its own derivative is the first thing to look for.
:::
:::

::: nameit
## A scan, cheapest first

1. **Simplify.** Expand, split a fraction, or use an identity: $\sin^2 x = \tfrac12(1 - \cos 2x)$ turns a hard integral into an easy one.
2. **Look for a function next to its derivative.** $f(g(x))\,g'(x)$ means substitute $u = g(x)$. Examples: $xe^{x^2}$, $\frac{\ln x}{x}$, $\sin^n x\cos x$.
3. **Products of unlike kinds.** A polynomial times an exponential, sine or logarithm suggests parts, with $u$ chosen as whatever gets simpler when differentiated (polynomials, logs).
4. **Rational functions.** Divide first if the top's degree is at least the bottom's, then use partial fractions. A leftover irreducible quadratic gives an arctangent.
5. **Square roots of quadratics.** $\sqrt{a^2 - x^2}$, $\sqrt{a^2 + x^2}$ and $\sqrt{x^2 - a^2}$ suggest $x = a\sin\theta$, $a\tan\theta$ or $a\sec\theta$.
6. **Powers of sine and cosine.** An odd power: save one factor and convert the rest. Even powers only: use the half-angle identities.
7. **None of these?** Try a substitution that removes the awkward part (such as $u = \sqrt x$), then scan again. Many integrals need two methods in a row.
8. **Still nothing?** It may have no elementary antiderivative ($e^{-x^2}$, $\frac{\sin x}{x}$). Then use a series or a numerical rule.

## Check every answer

Differentiate what you found. It takes a few seconds and catches most sign and constant errors.
:::

::: example
## Evaluate $\displaystyle\int_0^2\frac{x}{x^2 + 4}\,dx$.

::: solution
1. **Substitute $u = x^2 + 4$.** Then $du = 2x\,dx$, and the limits become 4 and 8:
   $$\int_0^2\frac{x}{x^2 + 4}\,dx = \frac12\int_4^8\frac{du}{u}$$
   Changing the limits along with the variable saves converting back.
2. **Integrate.**
   $$\begin{aligned} \frac12\int_4^8\frac{du}{u} &= \frac12\ln 2 \\ &= 0.347 \end{aligned}$$

**Answer:** the integral is $\frac12\ln 2 = 0.347$.
:::
:::

::: example
## Evaluate $\displaystyle\int_0^{\pi/2}\sin^3 x\,dx$.

::: solution
1. **Save one $\sin x$.** It's an odd power, so save one $\sin x$ and write $\sin^2 x = 1 - \cos^2 x$:
   $$\sin^3 x = (1 - \cos^2 x)\sin x$$
2. **Substitute $u = \cos x$.** Then $du = -\sin x\,dx$:
   $$\begin{aligned} \int_0^{\pi/2}\sin^3 x\,dx &= \int_0^1(1 - u^2)\,du \\ &= 1 - \frac13 \\ &= \frac23 \end{aligned}$$

**Answer:** the integral is $\frac23$.
:::
:::

::: example
## Evaluate $\displaystyle\int_0^1 e^{\sqrt x}\,dx$.

::: solution
1. **Remove the awkward part.** No method applies directly, so let $u = \sqrt x$, $x = u^2$, $dx = 2u\,du$:
   $$\int_0^1 e^{\sqrt x}\,dx = \int_0^1 2ue^u\,du$$
2. **Integrate by parts.** It's a polynomial times an exponential:
   $$\int 2ue^u\,du = 2(u - 1)e^u$$
3. **Evaluate from 0 to 1.**
   $$\begin{aligned} \Big[2(u - 1)e^u\Big]_0^1 &= 0 - (-2) \\ &= 2 \end{aligned}$$
   Two methods in a row, each simple.

**Answer:** the integral is 2.
:::
:::

::: check
kind: choice

## Which method fits $\displaystyle\int x^2\ln x\,dx$?

- [ ] Substitution with $u = \ln x$
- [x] Integration by parts with $u = \ln x$
- [ ] Partial fractions
- [ ] A trigonometric substitution

::: misses
- [1] With $u = \ln x$, $du = dx/x$, but the $x^2$ doesn't become $1/x$, so it doesn't fit.
- [3] There's no fraction to split.
- [4] There's no square root of a quadratic.
:::
:::

::: check
kind: choice

## Which method fits $\displaystyle\int\frac{3x + 1}{x^2 - 1}\,dx$?

- [ ] Integration by parts
- [x] Partial fractions
- [ ] The substitution $u = x^2 - 1$ alone
- [ ] A trigonometric substitution

::: misses
- [1] A rational function with a factorable bottom is a job for partial fractions.
- [3] That handles the $3x$ part only partly; the $+1$ is left over. Splitting handles both.
- [4] There's no square root.
:::
:::

::: check
given: a = 1 | 2 | 4; b = 1 | 3
answer: ln((b^2 + a)/a)/2
tolerance: 0.5%

## Evaluate $\displaystyle\int_0^{\given{b}}\frac{x}{x^2 + \given{a}}\,dx$.

::: right
Right. Substitution gives $\frac12\ln\frac{b^2 + a}{a}$ = {answer}.
:::

::: misses
- [ln((b^2 + a)/a)] With $u = x^2 + a$, $du = 2x\,dx$: there's a ½.
- [atan(b/sqrt(a))/sqrt(a)] That's $\int\frac{dx}{x^2 + a}$. Here the top has an $x$.
- [any] Not yet. Substitute $u = x^2 + a$.
:::
:::

::: check
given: n = 3 | 5 | 7 | 9 | 11
answer: (2^((n - 1)/2)*((n - 1)/2)!)^2/n!
tolerance: 0.5%

## Evaluate $\displaystyle\int_0^{\pi/2}\sin^{\given{n}}x\,dx$.

::: right
Right. Saving one sine and substituting $u = \cos x$ gives {answer}.
:::

::: misses
- [any] Not yet. Write $\sin^{n-1}x = (1 - \cos^2 x)^{(n-1)/2}$ and let $u = \cos x$.
:::
:::

::: check
given: k = 1 | 2 | 4
answer: 2*((sqrt(k) - 1)*exp(sqrt(k)) + 1)
tolerance: 0.5%

## Evaluate $\displaystyle\int_0^{\given{k}}e^{\sqrt x}\,dx$.

::: right
Right. $u = \sqrt x$, then parts: $2(u - 1)e^u$ from 0 to $\sqrt{k}$, which is {answer}.
:::

::: misses
- [any] Not yet. Substitute $u = \sqrt x$ first, then integrate $2ue^u$ by parts.
:::
:::

::: check
kind: parts
given: a = 2 | 3; b = 1 | 2

## Choose a method and evaluate.

::: part
answer: (exp(a*b) - 1)/a - b
tolerance: 0.5%

### $\displaystyle\int_0^{\given{b}}\left(e^{\given{a}x} - 1\right)dx$

::: misses
- [any] Split it: $\int e^{ax} - \int 1$.
:::
:::

::: part
answer: ln(1 + b^2)^2/4
tolerance: 0.5%

### $\displaystyle\int_0^{\given{b}}\frac{x\ln(1 + x^2)}{1 + x^2}\,dx$

::: misses
- [any] $u = \ln(1 + x^2)$, $du = \frac{2x}{1 + x^2}dx$: it becomes $\frac12\int u\,du$.
:::
:::
:::

::: check
kind: derivation
vars: x = 0.1..3

## Evaluate $\int\sin^3 x\,dx$ by saving one sine.

::: step
answer: (1 - cos(x)^2)*sin(x)

### Rewrite $\sin^3 x$ using $\sin^2 x = 1 - \cos^2 x$.
:::

::: step
answer: cos(x)^3/3 - cos(x)

### With $u = \cos x$, $du = -\sin x\,dx$, integrate. Write the answer in $x$.
:::

::: right
Right. $\int\sin^3 x\,dx = \frac{\cos^3x}{3} - \cos x + C$. Differentiate it to check.
:::
:::

::: explain
## Why is it worth trying the cheapest method first, instead of starting with the most powerful one?

::: model
Every method works by turning the integral into an easier one, and the cheap methods, simplifying and substitution, either work in a line or obviously fail. The powerful ones cost more and can hide the simple structure: a trigonometric substitution on $\frac{x}{x^2 + 4}$ works, but it takes several lines and an identity for an answer that substitution gives at once, and each extra step is a chance to drop a sign or a constant. Scanning cheapest first also builds the habit of looking at the integrand's shape, which is what lets you spot a two-step plan, like substituting to remove a square root and then integrating by parts. And when nothing fits, the scan tells you quickly to stop hunting and use a series or a numerical rule.
:::
:::

::: practice

::: check
given: a = 0.5..10; b = 0.5..5
answer: ln((b^2 + a)/a)/2
tolerance: 0.5%

## $\int_0^{\given{b}}\frac{x}{x^2 + \given{a}}\,dx$?

::: misses
- [any] Substitute $u = x^2 + a$.
:::
:::

::: check
given: k = 0.5..9
answer: 2*((sqrt(k) - 1)*exp(sqrt(k)) + 1)
tolerance: 0.5%

## $\int_0^{\given{k}}e^{\sqrt x}\,dx$?

::: misses
- [any] $u = \sqrt x$, then parts.
:::
:::
:::
