Integration by substitution (source code)

= Integration by substitution
{title2=$\int f(g(x))g'(x)\,dx=F(g(x))+C$}

= Substitution rule
{synonym}

If $F'=f$ and $g$ is differentiable, the <chain rule> gives $(F\circ g)'(x)=f(g(x))g'(x)$. Taking <antiderivatives> gives the substitution rule
$$
\boxed{\int f(g(x))g'(x)\,dx=F(g(x))+C.}
$$
Writing $u=g(x)$ and $du=g'(x)\,dx$ records this <chain rule> in reverse. For a <continuous function> $f$ and continuously differentiable $g$, the <fundamental theorem of calculus> gives the corresponding <definite integral> identity
$$
\int_a^b f(g(x))g'(x)\,dx=\int_{g(a)}^{g(b)}f(u)\,du.
$$
The order of the transformed endpoints determines the sign. For example, $\int_0^1 2x\cos(x^2)\,dx=\int_0^1\cos u\,du=\sin1$. If the substitution is used in the opposite direction by solving $x$ as a function of $u$, one must restrict to a suitable inverse branch; the <tangent half-angle substitution> illustrates why separate branches can be necessary even when the original integrand is smooth. The general <change of variables formula> extends substitution to higher dimensions.