Why This Matters
Most functions do not have immediately obvious antiderivatives. When you see the integral of 2x * cos(x^2), it is not clear how to proceed -- until you recognize that 2x is the derivative of x^2, and cos is being applied to x^2. This is the chain rule in reverse, and u-substitution is the systematic technique for exploiting this pattern.
The idea of change of variable is simple: replace a complicated expression with a single variable u, rewrite the entire integral in terms of u, integrate, then substitute back. If u = x^2, then du = 2x dx, and the integral of 2x * cos(x^2) dx becomes the integral of cos(u) du = sin(u) + C = sin(x^2) + C.
U-substitution is the most frequently used integration technique in all of calculus. It works whenever the integrand contains a function and its derivative multiplied together -- which happens far more often than you might expect. Mastering this technique is essential for evaluating the integrals that arise in physics, probability, and engineering.
Define Terms
Visual Model
The full process at a glance. Click Start tour to walk through each step.
U-substitution: identify the inner function, compute du, rewrite in terms of u, integrate, and substitute back.
Code Example
// Numerical verification of u-substitution
function trapezoidalRule(f, a, b, n = 10000) {
const dx = (b - a) / n;
let sum = f(a) + f(b);
for (let i = 1; i < n; i++) {
sum += 2 * f(a + i * dx);
}
return (dx / 2) * sum;
}
// Example 1: integral of 2x * cos(x^2) dx from 0 to sqrt(pi)
// u = x^2, du = 2x dx
// Becomes: integral of cos(u) du from 0 to pi
// = sin(u) from 0 to pi = sin(pi) - sin(0) = 0
console.log("Example 1: integral of 2x*cos(x^2) from 0 to sqrt(pi)");
const original1 = trapezoidalRule(x => 2 * x * Math.cos(x * x), 0, Math.sqrt(Math.PI));
const substituted1 = trapezoidalRule(Math.cos, 0, Math.PI); // In u-space
console.log(` Original integral: ${original1.toFixed(6)}`);
console.log(` After u-sub (u-bounds): ${substituted1.toFixed(6)}`);
console.log(` Exact (sin(pi) - sin(0)): ${(Math.sin(Math.PI) - Math.sin(0)).toFixed(6)}\n`);
// Example 2: integral of (2x+1)^5 dx from 0 to 1
// u = 2x + 1, du = 2 dx, so dx = du/2
// When x=0, u=1; when x=1, u=3
// Becomes: (1/2) * integral of u^5 du from 1 to 3
// = (1/2) * [u^6/6] from 1 to 3 = (1/12) * (729 - 1) = 728/12
console.log("Example 2: integral of (2x+1)^5 from 0 to 1");
const original2 = trapezoidalRule(x => Math.pow(2 * x + 1, 5), 0, 1);
const exact2 = (1/12) * (729 - 1);
console.log(` Numerical: ${original2.toFixed(4)}`);
console.log(` Exact (FTC after u-sub): ${exact2.toFixed(4)}\n`);
// Example 3: integral of x * e^(x^2) from 0 to 1
// u = x^2, du = 2x dx, so x dx = du/2
// = (1/2) * integral of e^u du from 0 to 1 = (1/2)(e^1 - e^0) = (e-1)/2
console.log("Example 3: integral of x * e^(x^2) from 0 to 1");
const original3 = trapezoidalRule(x => x * Math.exp(x * x), 0, 1);
const exact3 = (Math.E - 1) / 2;
console.log(` Numerical: ${original3.toFixed(6)}`);
console.log(` Exact (e-1)/2: ${exact3.toFixed(6)}`);Interactive Experiment
Try these exercises:
- Verify the integral of 3x^2 * e^(x^3) from 0 to 1 using u = x^3. The answer should be e - 1.
- Try integrating sin(2x) using u = 2x. Compare with the known antiderivative -cos(2x)/2.
- For integral of 1/(1+x^2) dx from 0 to 1, try u = arctan(x). This integral equals arctan(1) - arctan(0) = pi/4.
- What happens when you choose the "wrong" u? Try u = cos(x) for integral of sin(x)cos(x) dx. Does it still work?
- Compute integral of x/sqrt(1+x^2) from 0 to 3 using u = 1+x^2.
Quick Quiz
Coding Challenge
Write a function called `verifyUSub` that takes the original integrand f (as a function of x), the simplified integrand g (as a function of u, after substitution), the u-substitution function u (maps x to u), and the original bounds a and b. Compute: (1) the numerical integral of f from a to b using the trapezoidal rule with n = 10000, (2) the numerical integral of g from u(a) to u(b) with n = 10000. Return true if they agree within 0.01.
Real-World Usage
U-substitution is indispensable in applied mathematics:
- Probability: Computing expected values and probabilities from non-standard distributions often requires substitution to transform the integrand into a recognizable form.
- Physics: Many physics integrals (work against a varying force, electromagnetic flux) require substitution to handle variable dependencies.
- Signal processing: The Fourier transform and its inverse use substitution techniques to switch between time and frequency domains.
- Differential equations: Separable ODEs are solved by substitution: moving variables to opposite sides and integrating each side with the appropriate substitution.
- Numerical methods: Change of variables is used to transform integrals with singularities or infinite bounds into well-behaved forms for numerical computation.