Skip to content

Integration by substitution

Integration by substitution simplifies a composite integrand by replacing an inner expression with a new variable. It is the integration counterpart of the chain rule.

The key recognition is

f(g(x))g(x)dx=F(g(x))+C,\int f(g(x))g'(x)\,dx=F(g(x))+C,

where F(u)=f(u)F'(u)=f(u). In words: look for an inner function and its derivative, perhaps multiplied by a constant.

You should be able to:

  • apply the chain rule
  • differentiate powers, exponentials, logarithms and trigonometric functions
  • use the standard results in integration basics
  • rearrange expressions and change the limits of a definite integral

Suppose u=g(x)u=g(x). Then

dudx=g(x),\frac{du}{dx}=g'(x),

so the differential notation du=g(x)dxdu=g'(x)\,dx records the factor needed when changing variable. Therefore

f(g(x))g(x)dx=f(u)du=F(u)+C=F(g(x))+C.\int f(g(x))g'(x)\,dx =\int f(u)\,du =F(u)+C =F(g(x))+C.

This is exactly the chain rule read backwards. For example,

ddx(x2+1)5=10x(x2+1)4.\frac{d}{dx}(x^2+1)^5=10x(x^2+1)^4.

Hence

10x(x2+1)4dx=(x2+1)5+C.\int 10x(x^2+1)^4\,dx=(x^2+1)^5+C.

The symbols dxdx and dudu are not decoration. They identify the variable with respect to which the integration is taking place.

For an indefinite integral:

  1. Choose uu to be an expression that simplifies the integrand.
  2. Differentiate it to obtain dudu in terms of dxdx.
  3. Rewrite the entire integral in terms of uu and dudu.
  4. Integrate with respect to uu.
  5. Substitute back to xx and add CC.
  6. Differentiate the answer to check it.

A good substitution usually removes a repeated inner expression, a root, a denominator, or a complicated power.

Worked example 1: a power of a linear expression

Section titled “Worked example 1: a power of a linear expression”

Find

(3x2)7dx.\int (3x-2)^7\,dx.

Let

u=3x2.u=3x-2.

Then du=3dxdu=3\,dx, so dx=13dudx=\frac13\,du. Replace both the bracket and dxdx:

(3x2)7dx=u7(13du)=13u88+C=(3x2)824+C.\begin{aligned} \int(3x-2)^7\,dx &=\int u^7\left(\frac13\,du\right)\\ &=\frac13\cdot\frac{u^8}{8}+C\\ &=\boxed{\frac{(3x-2)^8}{24}+C}. \end{aligned}

Check:

ddx((3x2)824)=824(3x2)7(3)=(3x2)7.\frac{d}{dx}\left(\frac{(3x-2)^8}{24}\right) =\frac8{24}(3x-2)^7(3) =(3x-2)^7.

The factor 13\frac13 compensates for the derivative of 3x23x-2.

Worked example 2: the derivative is present up to a constant

Section titled “Worked example 2: the derivative is present up to a constant”

Find

x(x2+4)6dx.\int x(x^2+4)^6\,dx.

Choose u=x2+4u=x^2+4. Since du=2xdxdu=2x\,dx,

xdx=12du.x\,dx=\frac12\,du.

Therefore

x(x2+4)6dx=12u6du=u714+C=(x2+4)714+C.\begin{aligned} \int x(x^2+4)^6\,dx &=\frac12\int u^6\,du\\ &=\frac{u^7}{14}+C\\ &=\boxed{\frac{(x^2+4)^7}{14}+C}. \end{aligned}

It is not necessary for 2x2x to appear exactly. A non-zero constant multiple can be adjusted outside the integral.

The pattern

f(x)f(x)dx=lnf(x)+C\boxed{\int\frac{f'(x)}{f(x)}\,dx=\ln|f(x)|+C}

is substitution with u=f(x)u=f(x).

Section titled “Worked example 3: numerator related to the denominator”

Find

6x13x2x+5dx.\int\frac{6x-1}{3x^2-x+5}\,dx.

Let

u=3x2x+5,du=(6x1)dx.u=3x^2-x+5, \qquad du=(6x-1)\,dx.

The integral becomes

1udu=lnu+C=ln3x2x+5+C.\int\frac1u\,du =\ln|u|+C =\boxed{\ln|3x^2-x+5|+C}.

Here 3x2x+5>03x^2-x+5>0 for every real xx, so ln(3x2x+5)+C\ln(3x^2-x+5)+C is also valid. Keeping the absolute value is the safe general form.

Worked example 4: split the numerator first

Section titled “Worked example 4: split the numerator first”

Find

x+3x2+4x+7dx.\int\frac{x+3}{x^2+4x+7}\,dx.

The derivative of the denominator is 2x+42x+4, but the numerator is not a constant multiple of it. Rewrite

x+3=12(2x+4)+1.x+3=\frac12(2x+4)+1.

Then

x+3x2+4x+7dx=122x+4x2+4x+7dx+1x2+4x+7dx.\begin{aligned} \int\frac{x+3}{x^2+4x+7}\,dx &=\frac12\int\frac{2x+4}{x^2+4x+7}\,dx +\int\frac1{x^2+4x+7}\,dx. \end{aligned}

The first integral is logarithmic. For the second, complete the square:

x2+4x+7=(x+2)2+3.x^2+4x+7=(x+2)^2+3.

Using 1z2+a2dz=1aarctanza+C\int\frac1{z^2+a^2}\,dz=\frac1a\arctan\frac za+C gives

12ln(x2+4x+7)+13arctan(x+23)+C.\boxed{ \frac12\ln(x^2+4x+7) +\frac1{\sqrt3}\arctan\left(\frac{x+2}{\sqrt3}\right)+C }.

This example shows an important limit of pattern matching: substitution may solve only part of an integral.

Evaluate

4xe2x2+1dx.\int 4x e^{2x^2+1}\,dx.

Let u=2x2+1u=2x^2+1. Then du=4xdxdu=4x\,dx, so

4xe2x2+1dx=eudu=eu+C=e2x2+1+C.\int 4x e^{2x^2+1}\,dx =\int e^u\,du =e^u+C =\boxed{e^{2x^2+1}+C}.

Find

sin3xcosxdx.\int \sin^3x\cos x\,dx.

Because ddx(sinx)=cosx\frac{d}{dx}(\sin x)=\cos x, choose u=sinxu=\sin x. Then du=cosxdxdu=\cos x\,dx:

sin3xcosxdx=u3du=u44+C=14sin4x+C.\begin{aligned} \int \sin^3x\cos x\,dx &=\int u^3\,du\\ &=\frac{u^4}{4}+C\\ &=\boxed{\frac14\sin^4x+C}. \end{aligned}

The notation sin3x\sin^3x means (sinx)3(\sin x)^3.

Worked example 7: a reciprocal trigonometric result

Section titled “Worked example 7: a reciprocal trigonometric result”

Find

cosx2+sinxdx.\int\frac{\cos x}{2+\sin x}\,dx.

Let u=2+sinxu=2+\sin x. Then du=cosxdxdu=\cos x\,dx, giving

cosx2+sinxdx=ln2+sinx+C.\boxed{\int\frac{\cos x}{2+\sin x}\,dx =\ln|2+\sin x|+C}.

Since 2+sinx12+\sin x\geq1, the expression inside the logarithm is always positive.

Substitutions that change the form completely

Section titled “Substitutions that change the form completely”

Sometimes the useful substitution is supplied in a question. You must transform every occurrence of xx and dxdx.

Use u=x+1u=\sqrt{x+1} to find

xx+1dx.\int\frac{x}{\sqrt{x+1}}\,dx.

From u=x+1u=\sqrt{x+1},

u2=x+1,x=u21,dx=2udu.u^2=x+1, \qquad x=u^2-1, \qquad dx=2u\,du.

Now transform the whole integrand:

xx+1dx=u21u(2u)du=(2u22)du=23u32u+C.\begin{aligned} \int\frac{x}{\sqrt{x+1}}\,dx &=\int\frac{u^2-1}{u}(2u)\,du\\ &=\int(2u^2-2)\,du\\ &=\frac23u^3-2u+C. \end{aligned}

Substitute back:

23(x+1)3/22x+1+C.\boxed{\frac23(x+1)^{3/2}-2\sqrt{x+1}+C}.

An equivalent simplified answer is 23(x2)x+1+C\frac23(x-2)\sqrt{x+1}+C. Different looking antiderivatives are acceptable if they differ only by a constant.

For a definite integral, change the limits from xx values to uu values as soon as you substitute:

abf(g(x))g(x)dx=g(a)g(b)f(u)du.\int_a^b f(g(x))g'(x)\,dx =\int_{g(a)}^{g(b)}f(u)\,du.

Once the limits are in uu, do not substitute back to xx. Alternatively, find an antiderivative in xx and retain the original limits. Do not mix the two approaches.

Evaluate

012x(x2+3)4dx.\int_0^1 2x(x^2+3)^4\,dx.

Let u=x2+3u=x^2+3, so du=2xdxdu=2x\,dx. Transform the limits:

x=0u=3,x=1u=4.x=0\Rightarrow u=3, \qquad x=1\Rightarrow u=4.

Therefore

012x(x2+3)4dx=34u4du=[u55]34=45355=7815.\begin{aligned} \int_0^1 2x(x^2+3)^4\,dx &=\int_3^4u^4\,du\\ &=\left[\frac{u^5}{5}\right]_3^4\\ &=\boxed{\frac{4^5-3^5}{5}}\\ &=\boxed{\frac{781}{5}}. \end{aligned}

Worked example 10: a decreasing substitution

Section titled “Worked example 10: a decreasing substitution”

Evaluate

01x(4x2)2dx.\int_0^1\frac{x}{(4-x^2)^2}\,dx.

Let u=4x2u=4-x^2. Then du=2xdxdu=-2x\,dx, so xdx=12dux\,dx=-\frac12du. The new limits are

x=0u=4,x=1u=3.x=0\Rightarrow u=4, \qquad x=1\Rightarrow u=3.

Thus

01x(4x2)2dx=1243u2du=1234u2du=12[u1]34=124.\begin{aligned} \int_0^1\frac{x}{(4-x^2)^2}\,dx &=-\frac12\int_4^3u^{-2}\,du\\ &=\frac12\int_3^4u^{-2}\,du\\ &=\frac12\left[-u^{-1}\right]_3^4\\ &=\boxed{\frac1{24}}. \end{aligned}

The reversed uu limits are correct because u=4x2u=4-x^2 decreases as xx increases. Reversing the limits introduces a second minus sign.

Ask these questions in order:

  1. Is there a composite expression whose derivative also appears?
  2. Does a denominator have its derivative in the numerator?
  3. Would replacing a repeated bracket, root, exponential or trigonometric expression remove most occurrences of xx?
  4. Can algebraic simplification make the pattern visible first?
IntegrandUseful choiceReason
x(1+x2)8x(1+x^2)^8u=1+x2u=1+x^2du=2xdxdu=2x\,dx
ex1+ex\dfrac{e^x}{1+e^x}u=1+exu=1+e^xnumerator is uu'
cos(5x1)\cos(5x-1)u=5x1u=5x-1linear inner function
(lnx)4x\dfrac{(\ln x)^4}{x}u=lnxu=\ln xdu=1xdxdu=\dfrac1x\,dx
xx2+9\dfrac{x}{\sqrt{x^2+9}}u=x2+9u=x^2+9removes the root and xdxx\,dx

Substitution is not automatic whenever brackets appear. For example,

xexdx\int x e^x\,dx

has no single inner function whose derivative accounts for the other factor. It is naturally handled by integration by parts. A rational function may instead require partial fractions.

If u=x2+1u=x^2+1, writing

x(x2+1)5dx=xu5du\int x(x^2+1)^5\,dx=\int xu^5\,du

is invalid. The variables have been mixed. Use du=2xdxdu=2x\,dx, so xdx=12dux\,dx=\frac12du.

cos(4x)dxsin(4x)+C.\int\cos(4x)\,dx\ne\sin(4x)+C.

Differentiating the right side gives 4cos(4x)4\cos(4x). The correct result is

cos(4x)dx=14sin(4x)+C.\int\cos(4x)\,dx=\frac14\sin(4x)+C.

Before integrating, the new integral should contain only uu and dudu. If an xx remains, either express it in terms of uu or choose a better substitution.

After changing from xx to uu, the limits must also be uu values. Limits 00 and 11 do not retain their meaning merely because they are numbers.

Add CC to an indefinite integral. A definite integral is a number, and any constant cancels when the limits are applied.

Find

(5x+2)3dx.\int(5x+2)^{-3}\,dx.
Answer

Let u=5x+2u=5x+2, so dx=15dudx=\frac15du.

(5x+2)3dx=15u3du=110u2+C=110(5x+2)2+C.\int(5x+2)^{-3}\,dx =\frac15\int u^{-3}\,du =-\frac1{10}u^{-2}+C =\boxed{-\frac1{10(5x+2)^2}+C}.

Find

3x2x37dx.\int\frac{3x^2}{x^3-7}\,dx.
Answer

Take u=x37u=x^3-7, so du=3x2dxdu=3x^2\,dx:

3x2x37dx=lnx37+C.\boxed{\int\frac{3x^2}{x^3-7}\,dx=\ln|x^3-7|+C}.

The absolute value is needed because x37x^3-7 can be negative.

Find

e2x3+e2xdx.\int\frac{e^{2x}}{3+e^{2x}}\,dx.
Answer

Let u=3+e2xu=3+e^{2x}. Then du=2e2xdxdu=2e^{2x}\,dx, so

e2x3+e2xdx=12ln(3+e2x)+C.\boxed{\int\frac{e^{2x}}{3+e^{2x}}\,dx =\frac12\ln(3+e^{2x})+C}.

Evaluate

0π/4tanxdx.\int_0^{\pi/4}\tan x\,dx.
Answer

Write tanx=sinxcosx\tan x=\frac{\sin x}{\cos x} and let u=cosxu=\cos x. Then du=sinxdxdu=-\sin x\,dx. The limits become u=1u=1 and u=12u=\frac1{\sqrt2}:

0π/4tanxdx=11/21udu=[lnu]11/2=12ln2.\begin{aligned} \int_0^{\pi/4}\tan x\,dx &=-\int_1^{1/\sqrt2}\frac1u\,du\\ &=-[\ln u]_1^{1/\sqrt2}\\ &=\boxed{\frac12\ln2}. \end{aligned}

A student claims

2xx2+5dx=23(x2+5)3/2+C.\int 2x\sqrt{x^2+5}\,dx=\frac23(x^2+5)^{3/2}+C.

Is the answer correct?

Answer

Yes. With u=x2+5u=x^2+5, du=2xdxdu=2x\,dx, so

2xx2+5dx=u1/2du=23u3/2+C.\int2x\sqrt{x^2+5}\,dx =\int u^{1/2}\,du =\frac23u^{3/2}+C.

Do not reject a correct answer merely because the chain rule would produce an extra factor: here the factor 2x2x is already present.

  • State the substitution clearly, including dudu or dudx\frac{du}{dx}.
  • Show how any constant factor is handled.
  • For definite integrals, display the transformed limits before integrating.
  • Check an indefinite answer by differentiation.
  • Estimate the sign and size of a definite answer when possible.

Next, learn how reversing the product rule leads to integration by parts, and how algebraic decomposition prepares rational functions for integration using partial fractions. Return to definite integrals and areas when substitution is used inside area or accumulation problems.