# Integration by Substitution
## Introduction to this topic

This page is dedicated to teaching techniques for integration by substitution. For other integration methods, see other sources.
The first section introduces the theory. Next comes a demonstration of the technique; this is followed by a section listing the steps used in that demonstration. The last section is a series of clarifying examples.

## Assumed Knowledge

* Basic differentiation
* Basic integration methods
To understand the theory:
* Function composition: that a function $f(x)$ can also be written as $f(u(x))$, which we call the composition of $f(u)$ and $u(x)$.
* Chain rule

## Theory of Integration by Substitution

This area is covered by the Wikipedia article Integration by substitution. On this page we deal with the practical aspects.
We begin with the following as is described by the Wikipedia article
    $\int _{a}^{b}f(g(x))g'(x)\,dx=\int _{g(a)}^{g(b)}f(x)\,dx.$
This can be rewritten as
    $\int _^f(u)\,du.$
by setting
    $u=g(x)\,\qquad du=g'(x)\,dx.$
The principle applied here is function of a function (Function composition) and the reverse of the chain rule. This is the basis of integration by substitution. The key skill now is to identify what value we use for $u$ and following the process to solution.

## Integration by substitution

The objective of Integration by substitution is to substitute the integrand from an expression with variable $x$ to an expression with variable $u$ where $u\,=\,g(x)$
Theory We want to transform the Integral from a function of $x$ to a function of $u$
    $\int _{x=a}^{x=b}f(x)\,dx\,\rightarrow \,\int _{u=c}^{u=d}h(u)\,du$
Starting with
    $u\,=\,g(x)$
Steps
    $\int _{x=a}^{x=b}f(x)\,dx\,$ $=\int _{x=a}^{x=b}f(x)\,{\operatorname {d} \!u \over \operatorname {d} \!u}\,dx\,$ (1)ie ${\operatorname {d} \!u \over \operatorname {d} \!u}\,=\,1$ $=\int _{x=a}^{x=b}\left(f(x)\,{\operatorname {d} \!x \over \operatorname {d} \!u}\right)\left({\operatorname {d} \!u \over \operatorname {d} \!x}\right)\,dx\,$ (2)ie ${\operatorname {d} \!x \over \operatorname {d} \!u}{\operatorname {d} \!u \over \operatorname {d} \!x}\,=\,{\operatorname {d} \!u \over \operatorname {d} \!u}\,=\,1$ $=\int _{x=a}^{x=b}\left(f(x)\,{\operatorname {d} \!x \over \operatorname {d} \!u}\right)g'(x)\,dx\,$ (3)ie ${\operatorname {d} \!u \over \operatorname {d} \!x}\,=\,g'(x)$ $=\int _{x=a}^{x=b}h(g(x))g'(x)\,dx\,$ (4)ie Now equate $(f(x)\,{\operatorname {d} \!x \over \operatorname {d} \!u})$ with $h(g(x))$ $=\int _{x=a}^{x=b}h(u)g'(x)\,dx\,$ (5)ie $g(x)\,=\,u$ $=\int _{u=g(a)}^{u=g(b)}h(u)\,du\,$ (6)ie $du\,=\,{\operatorname {d} \!u \over \operatorname {d} \!x}dx\,=\,g'(x)\,dx\,$ $=\int _{u=c}^{u=d}h(u)\,du\,$ (7)ie We have achieved our desired result
Procedure
* Calculate $g'(x)\,=\,{\operatorname {d} \!u \over \operatorname {d} \!x}$
* Calculate $h(u)$ which is $f(x)\,{\operatorname {d} \!x \over \operatorname {d} \!u}\,=\,{\frac {f(x)}{g'(x)}}$ and make sure you express the result in terms of the variable $u$
* Calculate $c\,=\,g(a)$
* Calculate $d\,=\,g(b)$

## Technique
### Example 1

Let us examine this integral
    $\int _^(x-3)^{10}\,dx.$
The inner function is
    $x-3\,$
The outer function is
    $(\qquad )^{10}$
Recognising this relationship we then move onto the following set of steps to process the inner function NOTE: that the differential of $x-3$ is $1$.
    $u=x-3\,\qquad {\frac {du}{dx}}=1\,\qquad du=1\times dx\,\qquad du=dx\,$
Now we substitute $u$ and $du$ into the original integral.
    $\int _^(x-3)^{10}\,dx.\qquad =\int _^(u)^{10}\,du.$
Then apply standard integral technique
    ${\frac {u^{n+1}}{n+1}}+c\,\qquad {\frac {u^{11}}{11}}+c\,$
And finally we substitute the value of $u$ back into the equation
    ${\frac {(x-3)^{11}}{11}}+c\,$

### Example 2

Let us examine this integral
    $\int {\frac {x}{\sqrt {9+x^{2}}}}\,dx.$
We can first rearrange the fraction to make it more familiar.
    $\int x(9+x^{2})^{-{\frac {1}{2}}}\,dx.$
The inner function is
    $9+x^{2}\,$
The outer function is
    $x(\qquad )^{-{\frac {1}{2}}}$
Next we assign $u$ and $du$
    $u=9+x^{2}\,\qquad {\frac {du}{dx}}=2x\,$
But we have a problem! $du\,$ doesnt equal $x\,$! So we need to rearrange our formula for $du\,$.
    ${\frac {du}{dx}}=2x\,\qquad {\frac {du}{2}}=xdx\,\qquad {\frac {1}{2}}du=xdx\,$
Now we can substitute $u$ and $du$ into the original integral.
    $\int x(9+x^{2})^{-{\frac {1}{2}}}\,dx.\qquad {\frac {1}{2}}\int (u)^{-{\frac {1}{2}}}\,du.$
Study the above substitution carefully. We moved the fractional component of du to the front as it represents a constant.
Now apply standard integral technique
    ${\frac {u^{n+1}}{n+1}}+c\,\qquad {\frac {1}{2}}.{\frac {u^{\frac {1}{2}}}{\frac {1}{2}}}+c\,$
Cleaning up this expression we have
    $u^{\frac {1}{2}}+c\,$
And finally we substitute the value of u back into the equation
    $(9+x^{2})^{\frac {1}{2}}+c\,\qquad {\sqrt {9+x^{2}}}+c\,$

## The Definite Integral

Consider the definite integral
    $\int _{0}^{2}x\cos(x^{2}+1)\,dx$
By using the substitution
    $u(x)=x^{2}+1\qquad {\frac {du}{dx}}=2x\,\qquad {\frac {du}{2}}=x\,dx$
Now because we have limits, we need to change them with respect to $u$. Note the value of the limits.
    $\int _{x=0}^{x=2}x\cos(x^{2}+1)\,dx$
       ${\begin{aligned}&u(0)=(0^{2}+1)=1\\&u(2)=(2^{2}+1)=5\end{aligned}}$
Now we have a new definite integral to solve
    ${\begin{aligned}&={\frac {1}{2}}\int _{u=1}^{u=5}\cos \,u\,du\\&={\frac {1}{2}}(\sin 5-\sin 1).\end{aligned}}$

## The Steps We Applied

Let's now review the steps for integration by substitution.
| | Indefinite Integral | Definite Integral |
| 1. | First identify that you have a function of a function. This skill comes with practice to identify candidates. | First identify that you have a function of a function. This skill comes with practice to identify candidates. |
| 2. | Identify $u$ and then find $du$ that is appropriate for the expression. | Identify $u$ and then find $du$ that is appropriate for the expression. |
| 3. | | Change limits for definite integrals. |
| 4. | Integrate using normal techniques. | Integrate using normal techniques. |
| 5. | Substitute back the values for u for indefinite integrals. | |
| 6. | Don't forget the constant of integration for indefinite integrals. | |

## Finding u

Let's look at more examples at finding $u$.

### Example 1

    $\int _{0}^{1}{\frac {x\cosh {\sqrt {4-x^{2}}}}{\sqrt {4-x^{2}}}}\,dx.$
| $u\,$ | ${\frac {du}{dx}}\,$ | $Limits\,$ | $u\,Integral\,$ |
| $u={\sqrt {4-x^{2}}}$ | ${\frac {du}{dx}}={\frac {1}{2}}(4-x^{2})^{\frac {-1}{2}}\times -2x\,$ | $-\int _{x=0}^{x=1}\cosh \,u\,du.$ | $-\int _{u=2}^{u={\sqrt {3}}}\cosh \,u\,du$ |
| | $=-x(4-x^{2})^{\frac {-1}{2}}$ | $u={\sqrt {4-1^{2}}}={\sqrt {3}}$ | $=-(\sinh \,2-\sinh \,{\sqrt {3}})$ |
| | $={\frac {-x}{\sqrt {4-x^{2}}}}$ | $u={\sqrt {4-0^{2}}}=2$ | $=-\sinh \,2+\sinh \,{\sqrt {3}}$ |
| | $du={\frac {-x}{\sqrt {4-x^{2}}}}\,dx.$ | | |

### Example 2

    $\int {\frac {1}{x(4+\ln ^{2}x)}}\,dx.$
Here we first perform the substitution $u=\ln x$, so that
    $u=\ln x\Rightarrow du={\frac {1}{x}}dx\Rightarrow dx=e^{u}du$
With this, we get
    $\int {\frac {1}{x(4+\ln ^{2}x)}}\,dx=\int {\frac {e^{u}}{e^{u}(4+u^{2})}}\,du=\int {\frac {1}{4+u^{2}}}\,du=$
    $={\frac {1}{2}}\arctan(u/2)+c={\frac {1}{2}}\arctan \left({\frac {\ln x}{2}}\right)+c$