---
title: "Integration techniques"
author:
  - name: "Fan Wang"
    affiliation: "Department of Economics, University of Houston"
    url: "https://fanwangecon.github.io/"
date: "2026-11-30"
---

**Part of [Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics](https://fanwangecon.github.io/Stam4Econ/).**  
[Main Stam4Econ site](https://fanwangecon.github.io/Stam4Econ/) | [View this section in the book](https://fanwangecon.github.io/Stam4Econ/math_integration/overview.html#integration-techniques) | [Author: Fan Wang](https://fanwangecon.github.io/) | [DOI: 10.5281/zenodo.24696926](https://doi.org/10.5281/zenodo.24696926)  
Date: 2026-11-30 | [HTML](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/math_integration/integration_techniques.html) | [PDF](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/math_integration/integration_techniques.pdf) | [QMD](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/math_integration/integration_techniques.qmd)

## Integration techniques

How do integration by parts and integration by substitution work? Integration by parts is linked to the derivative product rule, and integration by substitution is linked to the derivative chain rule.

### Integration by parts from the product rule

Starting from the product rule, we have:

$$
\frac{d}{dx}\big(u(x)v(x)\big) = u'(x)v(x) + u(x)v'(x).
$$

Moving terms around, we have:

$$
u(x)v'(x) = \frac{d}{dx}\big(u(x)v(x)\big) - u'(x)v(x).
$$

Now integrate both sides with respect to $x$:

$$
\int u(x)v'(x)\,dx
= \int \frac{d}{dx}\big(u(x)v(x)\big)\,dx
- \int u'(x)v(x)\,dx.
$$

Use the Fundamental Theorem of Calculus so that the middle term is left only with $u(x)v(x)$. And we know that $v'(x) = \frac{dv(x)}{dx}$, so $v'(x)dx = dv$. Similarly, $u'(x)dx = du$. Given these, we end up with the formula for integration by parts:

$$
\int u\,dv = uv - \int v\,du\,.
$$

### Integration by parts example

Suppose $Z$ is a nonnegative, continuously distributed random variable with density $f$ and finite mean. We are interested in:

$$
\int_0^{\infty} z f(z)\,dz
$$

We can rewrite the expression above using integration by parts. Choose $u=z$, then:

- with $u = z$
- then $du = dz$
- and $dv = f(z)dz$
- therefore, integrating both sides of $dv = f(z)dz$ over $z$, we have $v(z)= F(z) + C$, where $C$ is some constant. If $C = -1$, we have $v(z) = -(1-F(z))$, which turns out to be easier to work with.

Given these, we apply integration by parts, and arrive at the following formula:

$$
\int_0^{\infty} z f(z)\,dz
= \Big[-z(1-F(z))\Big]_0^{\infty} + \int_0^{\infty}(1-F(z))\,dz,
$$

Since $E[Z]<\infty$, the boundary term vanishes as the upper limit tends to infinity, giving the familiar tail-integral identity $E[Z]=\int_0^\infty (1-F(z))\,dz$. The expression above will be useful for a later exercise.

### Integration by Substitution from the chain rule

By reversing the chain rule, we arrive at the integration by substitution formula. From the chain rule, we have:

$$
\frac{d}{dx}H(\phi(x)) = H'(\phi(x))\phi'(x).
$$

Now rename $H'(u)$ as $g(u)$, (we do this to end up with the standard substitution form later), then we have:

$$
\frac{d}{dx}H(\phi(x)) = g(\phi(x))\phi'(x).
$$

Integrate both sides with respect to $x$:

$$
\int g(\phi(x))\phi'(x)\,dx = H(\phi(x)) + C.
$$

Since $H'(u)=g(u)$, this is equivalently written as

$$
\int g(\phi(x))\phi'(x)\,dx = \int g(u)\,du,
\quad \text{with } u=\phi(x),
$$

up to an additive constant.

### Integration by Substitution example

A distribution-based example for integration by substitution. Assume the CDF $F$ is continuously differentiable and strictly increasing on its support, with positive density $f$, and write $q_\tau=F^{-1}(\tau)$. Then $d\tau=f(x)\,dx$ under the change of variables below.

$$
\int_0^1 \frac{F_2(q_\tau)-F_1(q_\tau)}{f(q_\tau)}\,d\tau.
$$

By definition of quantile, $x=q_\tau$ means $\tau=F(x)$, therefore, differentiating both sides, we have:

$$
\frac{d\tau}{dx}=\frac{dF(x)}{dx}=f(x).
$$

Therefore, we have:

$$
d\tau=f(x)dx.
$$

Now we substitute out the integration over $\tau$ by integration over $x$. Rather than evaluating the CDF and pdf at $q_{\tau}$, which means looking at the quantile value corresponding to $\tau$, we move away from the $\tau$ and directly looking at the $x=q_{\tau}$.

The integral becomes:

$$
\int_0^1 \frac{F_2(q_\tau)-F_1(q_\tau)}{f(q_\tau)}\,d\tau
= \int \frac{F_2(x)-F_1(x)}{f(x)} f(x)\,dx
= \int \big(F_2(x)-F_1(x)\big)\,dx.
$$

Note that the bounds of the integral were previously $0$ to $1$, but after the transformation they become bounds over the support of $x$. 