# Substitution (Change of Variable) Rule

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

The substitution rule is in fact one of the most powerful rules for integration.

Suppose that 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`, according to the chain rule, `d/(dx)G(v(x))=G'(v(x))v'(x)=g(v(x))v'(x)`, where `G'=g`.

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

From the above formula, it follows that if we make the substitution `u=v(x)`, we will have `int f(x)dx=int g(u)du`.

Evaluate the integral `int g(u)du`, return back to the 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`, we have that `int g(v(x))v'(x)dx=int g(u)du`.

Note that the substitution rule can be treated as some sort of inverse of the chain rule.

Let's get over some examples to have a better understanding of the substitution rule.

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

At first glance, it may appear that this integral is impossible to solve, but the correct substitution will reduce this integral to an easy one.

So, first of all, note that `(x^2)'=2x` and there is `x` near the exponent, so let's try the substitution `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 the derivative of the result: `(1/2e^(x^2))'=1/2e^(x^2)*(x^2)'=xe^(x^2)` (notice the use of the chain rule).

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

Now, what about the definite integral?

There are two possible ways:

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

The second method is preferable.

**Substitution Rule for Definite Integrals.** If `v'` is continuous on `[a,b]` and `g` is continuous on the range of `u=v(x)`, we have that `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)`.

On the other hand, since `u=x^2` and `x` is changing from `2` to `3`, `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 the substitution rule.

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

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

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

From this, it follows that `cos(u)=sqrt(1-sin^2(u))`, which is similar to what is in the denominator.

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

Plugging these results into the 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)`, we have that `u=asin(x)`.

So,

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

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

The following example will show that it is not always very clear which substitution to make.

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

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

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

As can be seen, the substitution `u=cos(2t+9)` is perfect, because it will remove the numerator and simplify the 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 the 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 the old variable gives that

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

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

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

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

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

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

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

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

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

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

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

At last, we can say that the change of variable technique is some sort of trial and error. This means that the correct evaluation of integrals using this technique will come as you gain 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 the chain rule, because this process is the 'inverse' of the substitution rule.