# Substitution (Change of Variable) Rule

## Related Calculator: Integral (Antiderivative) Calculator with Steps

Substitution Rule is in fact one of the most powerful rules for integration.

Suppose we want to find `int f(x)dx`.

If we can find such functions `g` and `v` that `f(x)dx=g(v(x))v'(x)dx` then according to Chain Rule `d/(dx)G(v(x))=G'(v(x))v'(x)=g(v(x))v'(x)` where `G'=g`.

As result we have that: `int f(x)dx=int g(v(x))v'(x)dx=G(v(x))+C`.

Frome above formula it follows that if we make substitution `u=v(x)` then

`int f(x)dx=int g(u)du`.

Evaluate integral `int g(u)du`, return back to old variables and you are done.

**Substitution Rule**. If `u=v(x)` is a differentiable function whose range is an interval `I` and `f` is continuous on `I`, then `int g(v(x))v'(x)dx=int g(u)du`.

Note, that Substitution Rule can be treated as some sort of inverse of Chain Rule.

Let's get over some examples to have better understanding of Substitution Rule.

**Example 1. ** Calculate `int xe^(x^2)dx`

From first glance it may appear that this integral is impossible to solve, but correct substituion will reduce this integral to easy one.

So, first of all note that `(x^2)'=2x` and there is `x` near exponent, so let's try substituion `u=x^2.`

Then `du=(x^2)'dx=2xdx` or `xdx=(du)/2`.

So,

`int xe^(x^2)dx=int e^u(du)/2=1/2 int e^udu=1/2e^u+C`

Returning to the old variables gives that

`int xe^(x^2)dx=1/2e^(x^2)+C` .

Now, just for checking find derivative of the result: `(1/2e^(x^2))'=1/2e^(x^2)*(x^2)'=xe^(x^2)` (notice use of Chain Rule).

Note that choice of `u(x)` is crucial. For example substituion `u=x^3` will not make integral easier.

Now, what about definite integral?

There are two possible ways.

- Compute indefinite integral and use fundamental theorem of calculus.
- Without returning to old variables change integration limits and use fundamental theorem.

Second method is more preferable.

**The Substitution Rule for Definite Integrals**. If `v'` is continuous on `[a,b]` and `g` is continuous on the range of `u=v(x)`, then `int_a^b g(v(x))v'(x)dx=int_(v(a))^(v(b)) g(u)du`.

Let's see how this is done.

**Example 2. **Calculate `int_2^3 xe^(x^2)dx`

As was shown above `int xe^(x^2)dx=1/2e^(x^2)+C`

So, `int_2^3 xe^(x^2)dx=1/2e^(3^2)-1/2e^(2^2)=1/2(e^9-e^4)`.

From another side since `u=x^2` and `x` is changing from 2 to 3 then `u` is changing from `2^2=4` to `3^2=9`.

So,

`int_2^3 xe^(x^2)dx=1/2int_4^9 e^udu=1/2(e^9-e^4)` .

**Example 3**. Find `int_0^3 e^(3x)dx`.

Let `u=3x` then `du=3dx`, so `dx=(du)/3`.

`x` is changing from 0 to 3, so `u` is changing from `3*0=0` to `3*3=9`.

Therefore, `int_0^3 e^(3x)dx=int_0^9 e^u (du)/3=1/3 e^u|_0^9=1/3(e^9-e^0)=1/3(e^9-1)`.

Now let's return to indefinite integrals to see more examples of using of Substitution Rule.

**Example 4. **Calculate `int 1/sqrt(1-x^2)dx`.

First of all there is restriction that `|x|<1` , otherwise value under square root is negative.

Now, to the integral. It is always important to think how any integral can be reduced to easy one. In this case trigonometric identity `cos^2(u)+sin^2(u)=1` is very useful.

From it follows that `cos(u)=sqrt(1-sin^2(u))`, which is exactly that is in denominator.

So, make substituion `x=sin(u)` , then `dx=(sin(u))'d u` or `dx=cos(u)du`.

Plugging these results into integral gives the following:

`int 1/sqrt(1-x^2)dx=int 1/sqrt(1-sin^2(u))cos(u)du=int 1/cos(u)cos(u)du=int du=u +C`

Now, since `x=sin(u)` then `u=arcsin(x)`.

So,

`int 1/sqrt(1-x^2)dx=arcsin(x)+C` , `|x|<1` .

Note how in example 1 we've made substitution `u=u(x)=x^2` and in last example we've made substitution `x=x(u)=sin(u)`. In some cases it is easier to find `u=u(x)`, in some `x=x(u)`.

Following example will show that it is not always very clear what substitution to make.

**Example 5.** Find `int tan(2t+9)dt`

It is only one term under integral, namely `tan`, so it is not very clear what substituion to make. However, recall that `tan(x)=sin(x)/cos(x)`. So, integral can be rewritten as follows:

`int tan(2t+9)dt=int (sin(2t+9))/(cos(2t+9))dt`.

As can be seen substitution `u=cos(2t+9)` is perfect, because it will remove numerator and simplify denominator. In this case `du=(cos(2t+9))'dt=-sin(2t+9)*(2t+9)'dt=-2sin(2t+9)dt`, so `sin(2t+9)dt=-(du)/2`.

This simplifies integral to:

`int sin(2t+9)/cos(2t+9)dt=int (-(du)/2)/(u)=-1/2 int (du)/u=-1/2 ln(u)+C`.

Returning to old variable gives that

`int tan(2t+9)=-1/2ln(cos(2t+9))+C`.

It is very important to "read" integral to define the better substitution.

**Example 6**. Find `int (cos(x))/(1+sin^2(x))dx`.

Let's "read this integral": in denominator we have something like `int 1/(1+t^2)dt=arctan(t)`.

In numerator we have `cos(x)` which is derivative of `sin(x)`. Therefore, substitution `t=sin(x)` will work.

So, `dt=cos(x)dx` and integral can be rewritten as `int 1/(1+t^2)=arctan(t)+C`.

Returning to old variables gives that `int (cos(x))/(1+sin^2(x))dx=arctan(sin(x))+C`.

**Example 7**. Find `int (2x)/(x^2+1)dx`.

In denominator we have something similar to derivative of inverse tangent, but numerator is not the same. But since `(x^2+1)'=2x` then we can make substitution `u=x^2+1`. In this case `du=2xdx` and integral can be rewritten as follows:

`int (du)/u=ln|u|+C`.

Returning to old variables gives that `int (2x)/(x^2+1)dx=ln(x^2+1)+C`.

At last we want to say that change of variable technique is some sort of trial and error. This means that correct evaluating of integrals using this technique will come with experience, and at the beginning you should try different substitutions and understand why some are good and some are awful. It is also a good idea to practice chain rule, because it is "inverse" process to substitution rule.