MATH-101 · Lesson 1 of 5 · 53 min

Integration by substitution and parts

In Calculus I you integrated functions whose antiderivatives you could read straight off a table: powers, exponentials, sines and cosines. Most integrals that come up in engineering are not that simple. They involve products, compositions and quotients, such as the energy in a decaying current, the RMS value of an alternating voltage, or the response of a system to a step input.

Differentiation has a rule for every situation: product, quotient, chain. Integration does not. Instead, there is a set of techniques that turn a hard integral into an easier one. This lesson covers the four you will use most: substitution, integration by parts, trigonometric identities and partial fractions. It finishes with a strategy for choosing between them and what to do when none of them works.

The basic table

Every technique ends by reducing an integral to one of a short list of standard forms. Know these by heart:

  • \(\int x^n\,dx = \dfrac{x^{n+1}}{n+1} + C\) for \(n \ne -1\), and \(\int \dfrac{dx}{x} = \ln|x| + C\)
  • \(\int e^{x}\,dx = e^{x} + C\) and \(\int a^{x}\,dx = \dfrac{a^{x}}{\ln a} + C\)
  • \(\int \sin x\,dx = -\cos x + C\), \(\int \cos x\,dx = \sin x + C\), \(\int \sec^2 x\,dx = \tan x + C\)
  • \(\int \dfrac{dx}{1 + x^2} = \arctan x + C\) and \(\int \dfrac{dx}{\sqrt{1 - x^2}} = \arcsin x + C\)

Remember that you can always check an antiderivative by differentiating it. This habit is even more valuable in Calculus II, where answers can look very different from the integrand.

Substitution

Substitution is the chain rule run backward. The chain rule says \(\dfrac{d}{dx}F(g(x)) = F'(g(x))\,g'(x)\). Reading this as an integral:

\[\int f\big(g(x)\big)\,g'(x)\,dx = \int f(u)\,du \quad \text{where } u = g(x)\]

In practice: look for a function inside another function whose derivative also appears in the integrand (up to a constant factor). Name the inside function \(u\), replace \(g'(x)\,dx\) with \(du\), and the integral should become simpler and contain only \(u\).

Worked problem

The derivative is right there

Find \(\int 2x\cos(x^2)\,dx\).

Show solution
  1. The inside function is \(x^2\), and its derivative \(2x\) multiplies the cosine. Let \(u = x^2\), so \(du = 2x\,dx\).
  2. \(\int \cos u\,du = \sin u + C\).
  3. Substitute back: \(\sin(x^2) + C\).

Answer: sin(x²) + C

Worked problem

Adjusting a constant

Find \(\int \dfrac{x}{x^2 + 1}\,dx\).

Show solution
  1. Let \(u = x^2 + 1\). Then \(du = 2x\,dx\), so \(x\,dx = \tfrac12 du\).
  2. \(\int \dfrac{1}{u}\cdot\dfrac12 du = \tfrac12\ln|u| + C\).
  3. Since \(x^2 + 1 > 0\), the absolute value is not needed.

Answer: ½ ln(x² + 1) + C

A missing constant factor is never a problem: you can multiply and divide by it. A missing variable factor is a problem. You cannot use \(u = x^2 + 1\) on \(\int \dfrac{1}{x^2 + 1}\,dx\), because there is no \(x\) to absorb the \(dx\). That integral needs a different idea (it is \(\arctan x + C\)).

Worked problem

Tangent

Find \(\int \tan x\,dx\).

Show solution
  1. Write \(\tan x = \dfrac{\sin x}{\cos x}\). The derivative of \(\cos x\) is \(-\sin x\), which appears on top.
  2. Let \(u = \cos x\), so \(du = -\sin x\,dx\).
  3. \(\int \dfrac{-du}{u} = -\ln|u| + C = -\ln|\cos x| + C\).

Answer: −ln|cos x| + C, which can also be written ln|sec x| + C

Definite integrals by substitution

For a definite integral, change the limits to values of \(u\) at the same time as you change the variable. Then you finish entirely in terms of \(u\) and never substitute back.

Worked problem

Changing the limits

Evaluate \(\int_0^{\pi/2} \sin^3 x\cos x\,dx\).

Show solution
  1. Let \(u = \sin x\), so \(du = \cos x\,dx\).
  2. Limits: \(x = 0\) gives \(u = 0\); \(x = \pi/2\) gives \(u = 1\).
  3. \(\int_0^1 u^3\,du = \left[\tfrac14 u^4\right]_0^1 = \tfrac14\).

Answer: 1/4

Integration by parts

Integration by parts is the product rule run backward. Starting from \((uv)' = u'v + uv'\) and integrating both sides:

\[\int u\,dv = uv - \int v\,du\]

The idea is to split the integrand into two parts: \(u\), which you will differentiate, and \(dv\), which you will integrate. The formula trades the original integral for \(\int v\,du\), which should be simpler.

Choosing well is the whole skill. A popular guide is the order LIATE: choose \(u\) from whichever type comes first in the list Logarithmic, Inverse trig, Algebraic (powers of \(x\)), Trigonometric, Exponential. Functions early in the list get simpler when differentiated; functions late in the list are easy to integrate.

Worked problem

Polynomial times exponential

Find \(\int x e^{x}\,dx\).

Show solution
  1. By LIATE, \(u = x\) (algebraic) and \(dv = e^{x}dx\) (exponential).
  2. Then \(du = dx\) and \(v = e^{x}\).
  3. \[\int x e^{x}\,dx = x e^{x} - \int e^{x}\,dx = x e^{x} - e^{x} + C\]

Answer: eˣ(x − 1) + C

Worked problem

Polynomial times sine

Find \(\int x\sin x\,dx\).

Show solution
  1. \(u = x\), \(dv = \sin x\,dx\). So \(du = dx\) and \(v = -\cos x\).
  2. \[\int x\sin x\,dx = -x\cos x + \int \cos x\,dx = -x\cos x + \sin x + C\]

Answer: −x cos x + sin x + C

Worked problem

A logarithm on its own

Find \(\int \ln x\,dx\).

Show solution
  1. There seems to be only one part, but write the integrand as \(\ln x \cdot 1\). Take \(u = \ln x\) and \(dv = dx\).
  2. Then \(du = \dfrac{1}{x}dx\) and \(v = x\).
  3. \(\int \ln x\,dx = x\ln x - \int x\cdot\dfrac{1}{x}\,dx = x\ln x - x + C\).

Answer: x ln x − x + C

Repeated and cyclic integration by parts

Sometimes one application is not enough. With \(x^2 e^{x}\), the first round lowers the power to \(x e^{x}\), and a second round finishes the job.

Worked problem

Two rounds

Evaluate \(\int_0^1 x^2 e^{x}\,dx\).

Show solution
  1. First round, \(u = x^2\), \(dv = e^{x}dx\): \(\int x^2 e^{x}dx = x^2 e^{x} - 2\int x e^{x}dx\).
  2. Use the earlier result for \(\int x e^{x}dx\): the antiderivative is \(x^2e^{x} - 2(x - 1)e^{x} = e^{x}(x^2 - 2x + 2)\).
  3. Evaluate: \(e(1 - 2 + 2) - e^{0}(2) = e - 2\).

Answer: e − 2 ≈ 0.718

With products like \(e^{x}\sin x\), the integral reappears after two rounds. Rather than going round forever, solve for it algebraically.

Worked problem

An integral that comes back

Find \(I = \int e^{x}\sin x\,dx\).

Show solution
  1. Round 1, \(u = \sin x\), \(dv = e^{x}dx\): \(I = e^{x}\sin x - \int e^{x}\cos x\,dx\).
  2. Round 2, \(u = \cos x\), \(dv = e^{x}dx\): \(\int e^{x}\cos x\,dx = e^{x}\cos x + \int e^{x}\sin x\,dx = e^{x}\cos x + I\).
  3. So \(I = e^{x}\sin x - e^{x}\cos x - I\). Add \(I\) to both sides and divide by 2.

Answer: I = ½eˣ(sin x − cos x) + C

Integrals of this type describe damped vibrations and the transient response of electrical circuits, where an exponential decay multiplies an oscillation.

Worked problem

Average life of a component

For components whose failure rate is constant, the fraction of failures at time \(t\) involves \(t e^{-t}\) (in units of the mean life). Evaluate \(\int_0^1 t e^{-t}\,dt\).

Show solution
  1. \(u = t\), \(dv = e^{-t}dt\), so \(du = dt\) and \(v = -e^{-t}\).
  2. \(\int t e^{-t}dt = -t e^{-t} + \int e^{-t}dt = -t e^{-t} - e^{-t} = -e^{-t}(t + 1)\).
  3. Evaluate from 0 to 1: \(-2e^{-1} - (-1) = 1 - \dfrac{2}{e}\).

Answer: 1 − 2/e ≈ 0.264. You will use the same integral from 0 to ∞ in Lesson 4 to find a mean life

Trigonometric integrals

Powers of sine and cosine are everywhere in engineering because alternating current, vibration and waves are all sinusoidal. The tools are the identities that rewrite powers as single trig functions:

\[\sin^2 x = \tfrac12(1 - \cos 2x) \qquad \cos^2 x = \tfrac12(1 + \cos 2x) \qquad \sin^2 x + \cos^2 x = 1\]

Worked problem

Square of a sine

Find \(\int \sin^2 x\,dx\).

Show solution
  1. Use the half-angle identity: \(\int \tfrac12(1 - \cos 2x)\,dx\).
  2. \(= \tfrac12 x - \tfrac14\sin 2x + C\).

Answer: x/2 − (sin 2x)/4 + C

For an odd power, such as \(\sin^3 x\), split off one factor and convert the rest using \(\sin^2 x = 1 - \cos^2 x\): \(\int \sin^3 x\,dx = \int (1 - \cos^2 x)\sin x\,dx\). Then substitute \(u = \cos x\). The answer is \(-\cos x + \tfrac13\cos^3 x + C\).

RMS values

The root-mean-square (RMS) value of a varying quantity is the square root of the average of its square. It is the value that matters for heating and power, because the power in a resistor depends on \(V^2\). For a sinusoidal voltage \(V_p\sin(\omega t)\) over one period \(T = 2\pi/\omega\):

\[V_{\text{rms}}^2 = \frac{1}{T}\int_0^{T} V_p^2\sin^2(\omega t)\,dt = \frac{V_p^2}{T}\left[\frac{t}{2} - \frac{\sin 2\omega t}{4\omega}\right]_0^{T} = \frac{V_p^2}{2}\]
Graph of sin² over one cycle with a dashed line at one half
Over a full cycle, sin² averages exactly ½: the humps above the line fill the dips below it.

So \(V_{\text{rms}} = V_p/\sqrt{2} \approx 0.707V_p\). Household supply in Canada is 120 V RMS, so the voltage actually peaks at about \(120\sqrt{2} \approx 170\) V. Insulation and components must be rated for the peak, while heating and power calculations use the RMS value.

Partial fractions

Rational functions (one polynomial divided by another) appear in control systems, chemical reaction rates and circuit analysis. The method of partial fractions splits them into simpler fractions you can integrate with logarithms or arctangents.

For a denominator that factors into distinct linear factors, write

\[\frac{3x + 5}{(x + 1)(x + 2)} = \frac{A}{x + 1} + \frac{B}{x + 2}\]

and find the constants. Multiply both sides by the denominator: \(3x + 5 = A(x + 2) + B(x + 1)\). Choosing values of \(x\) that zero out a term is the quickest route.

Worked problem

Partial fractions

Find \(\int \dfrac{3x + 5}{(x + 1)(x + 2)}\,dx\).

Show solution
  1. Set \(x = -1\): \(2 = A(1)\), so \(A = 2\). Set \(x = -2\): \(-1 = B(-1)\), so \(B = 1\).
  2. \(\int \left(\dfrac{2}{x + 1} + \dfrac{1}{x + 2}\right)dx = 2\ln|x + 1| + \ln|x + 2| + C\).

Answer: 2 ln|x + 1| + ln|x + 2| + C

Before splitting, check that the degree of the numerator is less than the degree of the denominator. If it is not, divide the polynomials first. Repeated factors such as \((x - 1)^2\) need a term for each power, \(\dfrac{A}{x - 1} + \dfrac{B}{(x - 1)^2}\), and an irreducible quadratic such as \(x^2 + 4\) needs a numerator \(Ax + B\). The same splitting is the core step in inverting Laplace transforms, which you will use in differential equations and control.

Worked problem

A difference of squares

Find \(\int \dfrac{dx}{x^2 - 1}\).

Show solution
  1. Factor: \(x^2 - 1 = (x - 1)(x + 1)\). Write \(\dfrac{1}{(x-1)(x+1)} = \dfrac{A}{x - 1} + \dfrac{B}{x + 1}\).
  2. \(1 = A(x + 1) + B(x - 1)\). At \(x = 1\): \(A = \tfrac12\). At \(x = -1\): \(B = -\tfrac12\).
  3. \(\tfrac12\ln|x - 1| - \tfrac12\ln|x + 1| + C = \tfrac12\ln\left|\dfrac{x - 1}{x + 1}\right| + C\).

Answer: ½ ln|(x − 1)/(x + 1)| + C

Choosing a technique

Faced with a new integral, work through these questions in order:

  • Can it be simplified first? Expand, cancel, split a fraction, or use an identity.
  • Is it on the basic table, perhaps after a constant adjustment?
  • Is there a function together with its derivative? Use substitution.
  • Is it a product of two different types of function (polynomial × exponential, polynomial × trig, logarithm × anything)? Use integration by parts.
  • Is it a power of sine or cosine? Use the identities.
  • Is it a rational function? Divide if needed, then use partial fractions.

With practice you will spot the right method quickly. When unsure, try one: an attempt that fails usually shows you why, and points to the right approach.

When there is no formula

Some perfectly ordinary functions have no antiderivative that can be written with standard functions. The most famous is \(e^{-x^2}\), the bell curve at the heart of statistics. Others include \(\dfrac{\sin x}{x}\) and \(\sqrt{1 + x^3}\). For these, engineers use numerical integration.

Simpson's rule fits parabolas through groups of three points and is remarkably accurate. With an even number \(n\) of strips of width \(h\):

\[\int_a^b f(x)\,dx \approx \frac{h}{3}\big[f_0 + 4f_1 + 2f_2 + 4f_3 + \cdots + 4f_{n-1} + f_n\big]\]

Worked problem

Simpson's rule

Estimate \(\int_0^1 e^{-x^2}\,dx\) with Simpson's rule and \(n = 4\).

Show solution
  1. \(h = 0.25\). Values: \(f(0) = 1\), \(f(0.25) = 0.93941\), \(f(0.5) = 0.77880\), \(f(0.75) = 0.56978\), \(f(1) = 0.36788\).
  2. Sum: \(1 + 4(0.93941) + 2(0.77880) + 4(0.56978) + 0.36788 = 8.96226\).
  3. Multiply by \(h/3 = 0.08333\): about 0.74686.

Answer: ≈ 0.74686. The true value is 0.746824, so four strips already give four correct digits

Common mistakes

  • MistakeSubstituting u but leaving some x in the integral, or forgetting to replace dx.

    InsteadAfter substitution, the integral must contain only u and du. If an x is left over, choose a different u.

  • MistakeIn a definite integral, changing to u but keeping the original x-limits.

    InsteadConvert the limits to u-values, or substitute back to x before evaluating.

  • MistakeChoosing u = eˣ and dv = x dx in ∫x eˣ dx, which makes the new integral harder.

    InsteadPick u to be the part that gets simpler when differentiated. LIATE is a reliable guide.

  • MistakeDropping the minus sign in uv − ∫v du, or when integrating sin x.

    InsteadWrite each part out (u, du, v, dv) before assembling, and remember ∫sin x dx = −cos x.

  • MistakeUsing partial fractions when the numerator's degree is not smaller than the denominator's.

    InsteadDivide the polynomials first, then split the remainder.

  • MistakeAssuming every integral has a formula and getting stuck.

    InsteadSome, like e^(−x²), do not. Use Simpson's rule or software for a numerical answer.

Summary and key terms

  • Substitution reverses the chain rule: look for a function and its derivative, set u to the inside function, and rewrite everything in u.
  • In definite integrals, change the limits when you change the variable.
  • Integration by parts reverses the product rule: ∫u dv = uv − ∫v du. Choose u using LIATE so that it simplifies when differentiated.
  • Some integrals need repeated parts; cyclic ones reappear and can be solved algebraically.
  • Powers of sine and cosine yield to identities such as sin² x = ½(1 − cos 2x). This gives V_rms = V_p/√2.
  • Partial fractions split rational functions into simple terms that integrate to logarithms.
  • Not every function has an elementary antiderivative; numerical methods such as Simpson's rule fill the gap.
Substitution
Replacing g(x) with u and g′(x)dx with du to simplify an integral.
Integration by parts
∫u dv = uv − ∫v du, from the product rule.
LIATE
A priority order for choosing u: logarithmic, inverse trig, algebraic, trig, exponential.
Half-angle identity
sin² x = ½(1 − cos 2x) and cos² x = ½(1 + cos 2x).
RMS value
The square root of the mean of the square; for a sine wave, peak ÷ √2.
Partial fractions
Writing a rational function as a sum of simpler fractions.
Simpson's rule
A numerical integration method that fits parabolas to the data.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Find \(\int x^2\sqrt{x^3 + 1}\,dx\).

    Show answer

    u = x³ + 1, du = 3x² dx. (1/3)∫u^(1/2) du = (2/9)(x³ + 1)^(3/2) + C.

  2. Find \(\int \dfrac{e^{x}}{1 + e^{x}}\,dx\).

    Show answer

    u = 1 + eˣ, du = eˣ dx. ∫du/u = ln(1 + eˣ) + C.

  3. Evaluate \(\int_0^{2} x e^{x^2}\,dx\).

    Show answer

    u = x², limits 0 to 4. ½∫ from 0 to 4 of eᵘ du = ½(e⁴ − 1) ≈ 26.8.

  4. Find \(\int x\cos 3x\,dx\).

    Show answer

    u = x, dv = cos 3x dx, v = (1/3) sin 3x. Result: (x/3) sin 3x + (1/9) cos 3x + C.

  5. Find \(\int x\ln x\,dx\).

    Show answer

    u = ln x, dv = x dx, v = x²/2. (x²/2) ln x − ∫(x/2) dx = (x²/2) ln x − x²/4 + C.

  6. Find \(\int \cos^2 x\,dx\) and use it to show that the average of \(\cos^2 x\) over \([0, 2\pi]\) is ½.

    Show answer

    ∫cos² x dx = x/2 + (sin 2x)/4 + C. From 0 to 2π this gives π, and π/(2π) = ½.

  7. A current \(i(t) = 10\sin(120\pi t)\) A flows in a resistor. What is the RMS current?

    Show answer

    Peak 10 A, so I_rms = 10/√2 ≈ 7.07 A.

  8. Find \(\int \dfrac{5x - 1}{(x - 1)(x + 2)}\,dx\).

    Show answer

    5x − 1 = A(x + 2) + B(x − 1). x = 1: A = 4/3. x = −2: B = 11/3. Result: (4/3) ln|x − 1| + (11/3) ln|x + 2| + C.

  9. Find \(\int \sin^3 x\,dx\).

    Show answer

    Write (1 − cos² x) sin x and let u = cos x: −cos x + (1/3)cos³ x + C.

  10. Use Simpson's rule with \(n = 2\) to estimate \(\int_0^2 x^3\,dx\). Why is the answer exact?

    Show answer

    h = 1: (1/3)(0 + 4(1) + 8) = 4, which equals the exact value. Simpson's rule is exact for cubics.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz