$u$-Substitution is our first "technique of integration" - beyond the basic power rule examples.

Consider the following derivative computed using the chain rule: $$ \frac{d}{dx} \sin(x^2) = 2x \cos(x^2). $$

Since integration is differentiation backward, this implies $$\int 2x \cos(x^2) \, dx = \sin(x^2) + C.$$

Or, dividing by $2$, $$\int x \cos(x^2) \, dx = \frac{1}{2}\sin(x^2) + C.$$

$u$-substitution is a systematic technique to recognize that a function that you might want to integrate might arise as a derivative where the chain rule was applied.

As a first example, we'll compute $$\int x \cos(x^2) \, dx,$$ pretending that we don't already know the answer!

Typically, you have a product of functions and one of those terms involves nested functions. In that case, you might consider setting $u$ to the inside part.

Thus, we'd let $u=x^2$ in this particular case.

So, to compute $$\int x \cos(x^2) \, dx = \int \cos(x^2) \, x\ dx,$$

we let $u=x^2$.

Then, $$\frac{du}{dx} = 2x \: \text{ so } \: \frac{1}{2}du = x\ dx.$$

Thus, $$\begin{aligned} \int x \cos(x^2) \, dx &= \int \cos(x^2) \, x \, dx = \int \cos(u) \frac{1}{2} du \\ &= \frac{1}{2} \int \cos(u) \, du = \frac{1}{2} \sin(u) + C \\ &= \frac{1}{2} \sin(x^2) + C. \end{aligned}$$

$$\int x^3 \, \sqrt{x^4+1} \, dx = ?$$

Solution: Let $u=x^4+1$.

Then, $\frac{du}{dx} = 4x^3$, so $x^3 dx = \frac{1}{4}du$.

Thus, $$\begin{aligned} \int x^3 \, \sqrt{x^4+1} \, dx &= \frac{1}{4} \int \sqrt{u} \, du = \frac{1}{4} \int u^{1/2} du \\ &= \frac{1}{4} \frac{2}{3} u^{3/2} = \frac{1}{6} \sqrt{x^4+1}. \end{aligned}$$

$$\int x \, \sqrt{x+1} \, dx = ?$$

Solution: Let $u=x+1$.

Then, $\frac{du}{dx} = 1$, so $dx = du$ and $x=u-1$.

Thus, $$\begin{aligned} \int x \, \sqrt{x+1} \, dx &= \int (u-1)\sqrt{u} \, du = \int (u-1)u^{1/2} \, du \\ &= \int \left(u^{3/2} - u^{1/2}\right) \, du = \frac{2}{5} u^{5/2} - \frac{2}{3} u^{3/2} \\ &= \frac{2}{5}(x+1)^{5/2} - \frac{2}{3}(x+1)^{3/2}. \end{aligned}$$

When evaluating definite integrals using $u$-substitution, it is (in my view) important to change the bounds of integration.

Or, as as Wikipedia says, $$\int_a^b f(\varphi(x))\varphi'(x)dx = \int_{\varphi(a)}^{\varphi(b)} f(u) du.$$

(Since, if $u=\varphi(x)$, then $\frac{du}{dx} = \varphi'(x)$, so $du=\varphi'(x)dx$.)

The key, new points are the $\varphi(a)$ and the $\varphi(b)$ in the bounds of integration.

$$\int_1^2 \sqrt{x-1} \, dx = ?$$

Solution: Let $u = x-1$, then $du=dx$.

Thus, $$\begin{aligned} \int_1^2 \sqrt{x-1} \, dx &= \int_0^1 \sqrt{u} \, du = \int_0^1 u^{1/2} \, du \\ &= \left.\frac{2}{3} u^{3/2}\right|_0^1 = \frac{2}{3}. \end{aligned}$$

$$\int_{-1}^{1} x^5\sin(x^4) \, dx = ?$$

Let $u=x^4$. Then $\frac{du}{dx} = 4x^3$ so $\frac{1}{4}du = x^3 \, dx$.

$$\begin{aligned}\int_{-1}^{1} x^5\sin(x^4) \, dx &= \int_{-1}^{1} x^2\sin(x^4) \, x^3dx \\ &= \frac{1}{4}\int_1^1 \sqrt{u} \sin(u) \, du = 0. \end{aligned}$$ Note that the final value of zero is simply because the top and bottom bounds of integration are the same.