Foundations to Frontier
Tests
A. Mathematical Foundations › A3 Calculus and Analysis › Single-variable calculus

Integration Techniques: Substitution, by Parts, Partial Fractions

Three tricks that undo the chain rule, the product rule and fraction addition. They solve control systems' responses, reshape random numbers, and power research tools like score matching and Stein's method.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Running the film backwards

Differentiating is like following a recipe forwards. Integrating means looking at the finished cake and working out the recipe. There’s no single rule for that, but there are tricks, each one a derivative rule run backwards:

  • The chain rule, backwards, is substitution.
  • The product rule, backwards, is integration by parts.
  • Adding fractions, backwards, is partial fractions: 12−13=16\tfrac12 - \tfrac13 = \tfrac16 read from right to left.
Substitution: the same area, measured in a new variable
x-world: 2x·cos(x²)
⇄ u = x²
u-world: cos u
∫ from 0.00 to 1.20 of 2x·cos(x²) dx = 0.991458 · ∫ from g(a) = 0.000 to g(b) = 1.440 of cos u du = 0.991458
The factor g′(x) stretches each sliver dx into du = g′(x) dx, so the two shaded (signed) areas are always equal, even though the shapes look different.
Why engineers care

When engineers design the motor controller for a robot joint or a satellite’s reaction wheel, they predict its response with exactly these tricks. Partial fractions split the system into simple pieces, and each piece is a decaying exponential they can read off directly.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Which function has derivative 2x (and is 0 at x = 0)?
  2. 2. ½ − ⅓ = ?
  3. 3. Integration by parts reverses which rule?

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

Substitution

If the integrand looks like f(g(x)) g′(x)f(g(x))\,g'(x), set u=g(x)u = g(x) and du=g′(x)dxdu = g'(x)dx:

∫f(g(x)) g′(x) dx=∫f(u) du\int f(g(x))\,g'(x)\,dx = \int f(u)\,du

Example. ∫2xcos⁡(x2) dx\int2x\cos(x^2)\,dx: with u=x2u = x^2, it becomes ∫cos⁡u du=sin⁡(x2)+C\int\cos u\,du = \sin(x^2) + C.

Integration by parts

∫u dv=uv−∫v du\int u\,dv = uv - \int v\,du

Example. ∫xex dx\int xe^x\,dx: take u=xu = x and dv=exdxdv = e^xdx. Then xex−∫exdx=(x−1)ex+Cxe^x - \int e^xdx = (x-1)e^x + C. So ∫01xex dx=0−(−1)=1\int_0^1xe^x\,dx = 0 - (-1) = 1.

Tip (LIATE): choose uu in the order Logarithmic, Inverse trig, Algebraic, Trigonometric, Exponential. The uu should get simpler when differentiated.

📝 Quick check (Level 1)
0/3 answered
  1. 1. ∫₀¹ 2x e^(x²) dx = ?
  2. 2. ∫₀¹ x eˣ dx = ?
  3. 3. For ∫ x ln x dx, choose u = …

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

More examples

Integral Technique Result
∫013x2(x3+1)2dx\int_0^13x^2(x^3+1)^2dx u=x3+1u = x^3 + 1, limits 1→21\to2 [u33]12=73\big[\tfrac{u^3}3\big]_1^2 = \tfrac73
∫1eln⁡x dx\int_1^e\ln x\,dx parts: u=ln⁡xu = \ln x, dv=dxdv = dx [xln⁡x−x]1e=1[x\ln x - x]_1^e = 1
∫0πxsin⁡x dx\int_0^\pi x\sin x\,dx parts [−xcos⁡x+sin⁡x]0π=π[-x\cos x + \sin x]_0^\pi = \pi
∫exsin⁡x dx\int e^x\sin x\,dx parts twice, then solve for the integral 12ex(sin⁡x−cos⁡x)\tfrac12e^x(\sin x - \cos x)
∫01xx2+1dx\int_0^1\frac{x}{x^2+1}dx u=x2+1u = x^2 + 1 12ln⁡2\tfrac12\ln2

For a definite substitution, change the limits too (uu from g(a)g(a) to g(b)g(b)), and you never need to go back to xx.

Partial fractions

A rational function with distinct linear factors splits as

N(x)(x−r1)⋯(x−rn)=∑iAix−ri,Ai=N(ri)∏j≠i(ri−rj)\frac{N(x)}{(x-r_1)\cdots(x-r_n)} = \sum_i\frac{A_i}{x - r_i}, \qquad A_i = \frac{N(r_i)}{\prod_{j\ne i}(r_i - r_j)}

This is the “cover-up” rule. Each piece integrates to a logarithm:

∫12dxx(x+1)=∫12(1x−1x+1)dx=ln⁡43\int_1^2\frac{dx}{x(x+1)} = \int_1^2\Big(\frac1x - \frac1{x+1}\Big)dx = \ln\frac43

Repeated factors contribute A(x−r)k\frac{A}{(x-r)^k} terms. Irreducible quadratics contribute Bx+Cx2+px+q\frac{Bx + C}{x^2 + px + q}, which integrate to arctan and log terms.

🐍 Exercise 1: partial fractions by cover-up
Implement the cover-up rule for distinct roots. Verify the decomposition at test points and integrate 1/(x(x+1)) on [1, 2] exactly.

When there is no formula

Some simple-looking integrals have no elementary antiderivative, for example e−x2e^{-x^2}, sin⁡xx\frac{\sin x}x and 1+x4\sqrt{1 + x^4}. Liouville (1835) explained why, and the Risch algorithm (1969) decides it automatically. Computer algebra systems (SymPy, Mathematica) implement parts of it. Otherwise, integrate numerically (A3.1-6).

📝 Quick check (Level 2)
0/3 answered
  1. 1. ∫₀^π x sin x dx = ?
  2. 2. In 1/(x² − 1) = A/(x − 1) + B/(x + 1), A = ?
  3. 3. ∫₀^{π/2} sin²x dx = ?

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Why the techniques are correct

Substitution. If F′=fF' = f, the chain rule gives ddxF(g(x))=f(g(x))g′(x)\frac{d}{dx}F(g(x)) = f(g(x))g'(x). By the FTC, ∫abf(g(x))g′(x)dx=F(g(b))−F(g(a))=∫g(a)g(b)f(u)du\int_a^bf(g(x))g'(x)dx = F(g(b)) - F(g(a)) = \int_{g(a)}^{g(b)}f(u)du. ∎

By parts. (uv)′=u′v+uv′(uv)' = u'v + uv'. Integrate both sides from aa to bb and rearrange. ∎

Reduction formulas

Parts often gives a recursion. With In=∫0π/2sin⁡nx dxI_n = \int_0^{\pi/2}\sin^nx\,dx, parts gives In=n−1nIn−2I_n = \frac{n-1}nI_{n-2}, with I0=π2I_0 = \frac\pi2 and I1=1I_1 = 1. Comparing even and odd terms leads to Wallis’s product π2=∏k(2k)2(2k−1)(2k+1)\frac\pi2 = \prod_k\frac{(2k)^2}{(2k-1)(2k+1)} (Wallis, 1656).

Similarly, the Gamma function Γ(s)=∫0∞xs−1e−xdx\Gamma(s) = \int_0^\infty x^{s-1}e^{-x}dx satisfies Γ(s+1)=sΓ(s)\Gamma(s+1) = s\Gamma(s) (by parts). So Γ(n+1)=n!\Gamma(n+1) = n!, and ∫0∞xne−xdx=n!\int_0^\infty x^ne^{-x}dx = n!.

Existence of partial fractions

Every real polynomial factors into linear and irreducible quadratic factors (the fundamental theorem of algebra). Bézout’s identity then shows every proper rational function decomposes uniquely into the standard pieces. So every rational function has an elementary antiderivative made of rationals, logs and arctans.

Exercise 3.1: Compute ∫ eˣ sin x dx

Let II be the integral. Parts twice gives I=exsin⁡x−∫excos⁡x=exsin⁡x−excos⁡x−II = e^x\sin x - \int e^x\cos x = e^x\sin x - e^x\cos x - I. So I=12ex(sin⁡x−cos⁡x)+CI = \tfrac12e^x(\sin x - \cos x) + C.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Γ(5) = ?
  2. 2. I₄ = ∫₀^{π/2} sin⁴x dx = ?
  3. 3. Integration by parts is the integral form of…

Level 4: Expert

★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.

Control engineering: Laplace transforms and partial fractions

The Laplace transform L{f}(s)=∫0∞f(t)e−stdt\mathcal L\{f\}(s) = \int_0^\infty f(t)e^{-st}dt turns ODEs into algebra. By parts gives the key rule L{f′}=sL{f}−f(0)\mathcal L\{f'\} = s\mathcal L\{f\} - f(0). A system’s step response Y(s)=Ks(s+a)(s+b)Y(s) = \frac{K}{s(s+a)(s+b)} is a rational function. Partial fractions split it into ∑Ais−pi\sum\frac{A_i}{s - p_i}, and each piece inverts to AiepitA_ie^{p_it}. This is how control engineers read stability and settling time straight from the poles (Ogata, 2010; Franklin, Powell and Emami-Naeini, 2019).

🐍 Exercise 2 (research): a robot joint's step response from partial fractions
For Y(s) = K/(s(s + a)(s + b)), compute the residues by cover-up, build y(t) = Σ Aᵢ e^(pᵢt), and match an RK4 simulation of the ODE to 10⁻⁹.

Research uses

  • Change of variables in probability. If Y=g(X)Y = g(X), then pY(y)=pX(x)∣dx/dy∣p_Y(y) = p_X(x)\lvert dx/dy\rvert. This is substitution. It powers inverse-transform sampling (Practice Code 4), the reparameterization trick in VAEs (Kingma and Welling, 2014), and normalizing flows, which stack invertible maps and track log⁡∣det⁡J∣\log\lvert\det J\rvert (Rezende and Mohamed, 2015; Dinh, Sohl-Dickstein and Bengio, 2017).
  • Integration by parts in ML. Score matching (Hyvärinen, 2005) uses parts to rewrite a loss that needs the unknown data density into one that doesn’t, which led to today’s diffusion models. Stein’s identity, E[f′(X)]=E[Xf(X)]\mathbb E[f'(X)] = \mathbb E[Xf(X)] for Gaussian XX (Stein, 1972; Practice Code 5), underlies Stein variational gradient descent and kernel goodness-of-fit tests.
  • Weak formulations. Finite-element methods move derivatives onto test functions by parts. This is how structural, thermal and fluid models of spacecraft are solved.

References

  1. J. Wallis (1656). Arithmetica Infinitorum.
  2. J. Liouville (1835). “Mémoire sur l’intégration d’une classe de fonctions transcendantes.” Journal für die reine und angewandte Mathematik, 13.
  3. R. Risch (1969). “The problem of integration in finite terms.” Transactions of the AMS, 139.
  4. C. Stein (1972). “A bound for the error in the normal approximation to the distribution of a sum of dependent random variables.” Proc. 6th Berkeley Symposium, 2.
  5. A. Hyvärinen (2005). “Estimation of non-normalized statistical models by score matching.” JMLR, 6.
  6. D. Kingma, M. Welling (2014). “Auto-encoding variational Bayes.” ICLR.
  7. D. Rezende, S. Mohamed (2015). “Variational inference with normalizing flows.” ICML.
  8. K. Ogata (2010). Modern Control Engineering, 5th ed. Prentice Hall. Chapter 2.
  9. G. Franklin, J. D. Powell, A. Emami-Naeini (2019). Feedback Control of Dynamic Systems, 8th ed. Pearson.