Integration · Class 12 · Lesson 03

Integration by substitution: the chain rule, run backwards.

Short answer

To integrate \(\int f\big(g(x)\big)\,g'(x)\,dx\), put \(u = g(x)\). Then \(du = g'(x)\,dx\) and the integral becomes \(\int f(u)\,du\).

Example: in \(\int 2x\cos(x^2)\,dx\), put \(u = x^2\), \(du = 2x\,dx\). You get \(\int \cos u\,du = \sin(x^2) + C\).

Class 12HSC & CBSEDiploma
01

Why substitution works

Substitution is the chain rule run backwards. When you differentiate \(F\big(g(x)\big)\), the chain rule gives \(F'\big(g(x)\big)\cdot g'(x)\). So if an integrand looks like a function of \(g(x)\), multiplied by \(g'(x)\), its integral is \(F\big(g(x)\big) + C\).

Writing \(u = g(x)\) makes this visible. The messy inner expression becomes a single letter, the factor \(g'(x)\,dx\) becomes \(du\), and you are left with an integral you already know.

Integration by substitution

If \(u = g(x)\), then \(du = g'(x)\,dx\) and \[\int f\big(g(x)\big)\,g'(x)\,dx = \int f(u)\,du\]

Quick example

\(\int 2x\,(x^2 + 1)^5\,dx\): put \(u = x^2 + 1\), \(du = 2x\,dx\). The integral is \(\int u^5\,du = \dfrac{u^6}{6} + C = \dfrac{(x^2 + 1)^6}{6} + C\).

You can always check the answer by differentiating it. Here \(\dfrac{d}{dx}\dfrac{(x^2 + 1)^6}{6} = (x^2 + 1)^5\cdot 2x\), which is the integrand. If you need a refresher on the forward direction, see the chain rule lesson.

02

The four-step method

  1. Choose \(u\). Usually the inside of a bracket, root, power or function, picked so that its derivative also appears in the integrand.
  2. Find \(du\). Differentiate: \(du = g'(x)\,dx\). Rearrange to get \(dx\) or \(g'(x)\,dx\) in terms of \(du\).
  3. Rewrite everything in \(u\). No \(x\) may be left over, and \(dx\) must be gone too. If an \(x\) refuses to go, try a different \(u\).
  4. Integrate, then put \(x\) back. Replace \(u\) by \(g(x)\) and add \(+ C\).

How to choose u

There is no single rule, but these patterns cover most Class 12 questions.

If the integrand hasTry
a bracket raised to a power, with the bracket's derivative outside\(u =\) the bracket
a fraction whose top is (a multiple of) the derivative of the bottom\(u =\) the denominator
\(e^{\text{something}}\) or \(\sin(\text{something})\)\(u =\) the something
\(\log x\) together with \(\dfrac{1}{x}\)\(u = \log x\)
\(\tan^{-1}x\) together with \(\dfrac{1}{1 + x^2}\)\(u = \tan^{-1}x\)
\(\sqrt{ax + b}\) with an extra \(x\) outside\(u = ax + b\), and write \(x\) in terms of \(u\)

The derivative only has to match up to a constant. For \(\int x\cos(x^2)\,dx\) the derivative of \(x^2\) is \(2x\), not \(x\). That's fine: \(x\,dx = \tfrac{1}{2}du\), and the \(\tfrac{1}{2}\) comes out in front.

03

Two patterns and four trig integrals

Two substitutions come up so often that it is worth knowing the results directly.

Standard patterns

\[\int \frac{f'(x)}{f(x)}\,dx = \log|f(x)| + C\]

\[\int [f(x)]^n f'(x)\,dx = \frac{[f(x)]^{n+1}}{n + 1} + C\]

The second needs \(n \ne -1\); for \(n = -1\) it is the first pattern.

Both come from \(u = f(x)\). The first turns into \(\int \dfrac{du}{u}\), the second into \(\int u^n\,du\). Spot the pattern and you can write the answer in one line: \(\int \dfrac{\cos x}{\sin x}\,dx = \log|\sin x| + C\), and \(\int \sin^4 x\cos x\,dx = \dfrac{\sin^5 x}{5} + C\).

Integrals of tan, cot, sec and cosec

These four are not in the basic table because you get them by substitution. Each derivation is short.

IntegralHowResult
\(\int \tan x\,dx\)\(\tan x = \dfrac{\sin x}{\cos x}\); \(u = \cos x\), \(du = -\sin x\,dx\)\(-\log|\cos x| + C = \log|\sec x| + C\)
\(\int \cot x\,dx\)\(\cot x = \dfrac{\cos x}{\sin x}\); \(u = \sin x\)\(\log|\sin x| + C\)
\(\int \sec x\,dx\)multiply top and bottom by \(\sec x + \tan x\); the top becomes the derivative of the bottom\(\log|\sec x + \tan x| + C\)
\(\int \operatorname{cosec} x\,dx\)multiply top and bottom by \(\operatorname{cosec} x - \cot x\)\(\log|\operatorname{cosec} x - \cot x| + C\)

The \(\sec x\) trick in full:

\[\int \sec x\,dx = \int \frac{\sec x(\sec x + \tan x)}{\sec x + \tan x}\,dx\]

\[= \int \frac{\sec^2 x + \sec x\tan x}{\sec x + \tan x}\,dx\]

The numerator is exactly the derivative of \(\sec x + \tan x\), so the first pattern gives \(\log|\sec x + \tan x| + C\). The cosec result can also be written \(\log\left|\tan\dfrac{x}{2}\right| + C\); both forms are correct.

04

Trigonometric substitutions

When the integrand has \(\sqrt{a^2 - x^2}\), \(a^2 + x^2\) or \(\sqrt{x^2 - a^2}\), put \(x\) equal to a trig function so that an identity removes the square root.

ExpressionSubstituteBecause
\(\sqrt{a^2 - x^2}\)\(x = a\sin\theta\)\(a^2 - a^2\sin^2\theta = a^2\cos^2\theta\)
\(a^2 + x^2\) or \(\sqrt{a^2 + x^2}\)\(x = a\tan\theta\)\(a^2 + a^2\tan^2\theta = a^2\sec^2\theta\)
\(\sqrt{x^2 - a^2}\)\(x = a\sec\theta\)\(a^2\sec^2\theta - a^2 = a^2\tan^2\theta\)

These substitutions give three standard results you will use again in partial fractions and definite integrals:

\[\int \frac{dx}{\sqrt{a^2 - x^2}} = \sin^{-1}\frac{x}{a} + C\]

\[\int \frac{dx}{a^2 + x^2} = \frac{1}{a}\tan^{-1}\frac{x}{a} + C\]

\[\int \frac{dx}{\sqrt{x^2 - a^2}} = \log\left|x + \sqrt{x^2 - a^2}\right| + C\]

The first holds for \(|x| < a\) and the third for \(|x| > a\). The method is the same at Diploma level. Example 8 below works one through.

05

Solved examples

Example 1: Inside a cosine

Easy

Evaluate \(\int 2x\cos(x^2)\,dx\).

  1. Put \(u = x^2\). Then \(du = 2x\,dx\), which is exactly the rest of the integrand.
  2. \(\int \cos u\,du = \sin u + C\).

Answer\(\sin(x^2) + C\)

Example 2: Top is the derivative of the bottom

Easy

Evaluate \(\displaystyle\int \frac{2x + 3}{x^2 + 3x + 5}\,dx\).

  1. The derivative of \(x^2 + 3x + 5\) is \(2x + 3\), the numerator. Put \(u = x^2 + 3x + 5\), \(du = (2x + 3)\,dx\).
  2. \(\int \dfrac{du}{u} = \log|u| + C\).
  3. The discriminant of \(x^2 + 3x + 5\) is \(9 - 20 < 0\), so it is always positive and the modulus can be dropped.

Answer\(\log(x^2 + 3x + 5) + C\)

Example 3: A log with 1/x

Easy

Evaluate \(\displaystyle\int \frac{(\log x)^2}{x}\,dx\), for \(x > 0\).

  1. Put \(u = \log x\). Then \(du = \dfrac{1}{x}\,dx\).
  2. \(\int u^2\,du = \dfrac{u^3}{3} + C\).

Answer\(\dfrac{(\log x)^3}{3} + C\)

Example 4: An extra x outside the root

Medium

Evaluate \(\int x\sqrt{x + 1}\,dx\), for \(x > -1\).

  1. Put \(u = x + 1\), so \(du = dx\). The \(x\) outside must also change: \(x = u - 1\).
  2. \(\int (u - 1)\sqrt{u}\,du = \int \left(u^{3/2} - u^{1/2}\right)du\).
  3. Integrate each power: \(\dfrac{2}{5}u^{5/2} - \dfrac{2}{3}u^{3/2} + C\).

Answer\(\dfrac{2}{5}(x + 1)^{5/2} - \dfrac{2}{3}(x + 1)^{3/2} + C\)

Example 5: An exponent with an inverse trig function

Medium

Evaluate \(\displaystyle\int \frac{e^{\tan^{-1}x}}{1 + x^2}\,dx\).

  1. Put \(u = \tan^{-1}x\). Then \(du = \dfrac{dx}{1 + x^2}\).
  2. \(\int e^u\,du = e^u + C\).

Answer\(e^{\tan^{-1}x} + C\)

Example 6: An odd power of sine

Medium

Evaluate \(\int \sin^3 x\,dx\).

  1. Keep one \(\sin x\) aside and change the rest to cosines: \(\sin^3 x = (1 - \cos^2 x)\sin x\).
  2. Put \(u = \cos x\), \(du = -\sin x\,dx\). The integral becomes \(-\int (1 - u^2)\,du\).
  3. \(-\int (1 - u^2)\,du = -u + \dfrac{u^3}{3} + C\).

Answer\(-\cos x + \dfrac{\cos^3 x}{3} + C\)

Example 7: Exponentials in the denominator

Exam level

Evaluate \(\displaystyle\int \frac{dx}{e^x + e^{-x}}\).

  1. Multiply top and bottom by \(e^x\): \(\dfrac{e^x}{e^{2x} + 1}\).
  2. Put \(u = e^x\), \(du = e^x\,dx\). The integral is \(\int \dfrac{du}{1 + u^2} = \tan^{-1}u + C\).

Answer\(\tan^{-1}(e^x) + C\)

Example 8: A tan substitution

Exam level

Evaluate \(\displaystyle\int \frac{dx}{(x^2 + 9)^{3/2}}\).

  1. Put \(x = 3\tan\theta\), with \(-\dfrac{\pi}{2} < \theta < \dfrac{\pi}{2}\). Then \(dx = 3\sec^2\theta\,d\theta\) and \(x^2 + 9 = 9\sec^2\theta\).
  2. So \((x^2 + 9)^{3/2} = 27\sec^3\theta\), and the integral is \(\displaystyle\int \frac{3\sec^2\theta}{27\sec^3\theta}\,d\theta = \frac{1}{9}\int \cos\theta\,d\theta\).
  3. That gives \(\dfrac{1}{9}\sin\theta + C\).
  4. Back to \(x\): \(\tan\theta = \dfrac{x}{3}\). Draw a right triangle with opposite side \(x\) and adjacent side 3; the hypotenuse is \(\sqrt{x^2 + 9}\), so \(\sin\theta = \dfrac{x}{\sqrt{x^2 + 9}}\).

Answer\(\dfrac{x}{9\sqrt{x^2 + 9}} + C\)

Vipul Sir's tip

Before you pick \(u\), look for a function and its derivative sitting side by side, like \(\tan^{-1}x\) and \(\dfrac{1}{1 + x^2}\) in Example 5. When you find that pair, the inner function is your \(u\). And always differentiate your final answer. It takes twenty seconds and catches most mistakes before the examiner does.

06

Common mistakes

1. Not changing \(dx\)

Wrong: \(\int \cos 3x\,dx = \sin 3x + C\). Differentiate that and you get \(3\cos 3x\), three times too big.

Right: with \(u = 3x\), \(du = 3\,dx\), so \(dx = \dfrac{du}{3}\) and \(\int \cos 3x\,dx = \dfrac{1}{3}\sin 3x + C\).

2. Leaving \(x\) and \(u\) mixed

In \(\int x\sqrt{x + 1}\,dx\) with \(u = x + 1\), some students write \(\int x\sqrt{u}\,du\) and then treat \(x\) as a constant. It isn't one. Every \(x\) has to be written in terms of \(u\): here \(x = u - 1\), as in Example 4.

3. Using the log rule when the top is not the derivative

Wrong: \(\int \dfrac{dx}{1 + x^2} = \log(1 + x^2) + C\). The derivative of \(1 + x^2\) is \(2x\), and there is no \(2x\) on top.

Right: \(\int \dfrac{dx}{1 + x^2} = \tan^{-1}x + C\). The pattern \(\int \dfrac{f'}{f}\,dx = \log|f| + C\) only applies when the numerator really is \(f'(x)\), up to a constant.

07

Practice questions

Try each one on paper before you open the answer.

Q1Evaluate \(\int x^2(x^3 + 1)^4\,dx\).

\(u = x^3 + 1\), \(du = 3x^2\,dx\), so \(x^2\,dx = \dfrac{du}{3}\).

\(\dfrac{1}{3}\int u^4\,du = \dfrac{(x^3 + 1)^5}{15} + C\).

Q2Evaluate \(\displaystyle\int \frac{e^{\sqrt{x}}}{\sqrt{x}}\,dx\), for \(x > 0\).

\(u = \sqrt{x}\), \(du = \dfrac{dx}{2\sqrt{x}}\), so \(\dfrac{dx}{\sqrt{x}} = 2\,du\).

\(2\int e^u\,du = 2e^{\sqrt{x}} + C\).

Q3Evaluate \(\displaystyle\int \frac{\sin(\log x)}{x}\,dx\), for \(x > 0\).

\(u = \log x\), \(du = \dfrac{dx}{x}\).

\(\int \sin u\,du = -\cos(\log x) + C\).

Q4Evaluate \(\displaystyle\int \frac{dx}{x\log x}\), for \(x > 1\).

\(u = \log x\), \(du = \dfrac{dx}{x}\), so the integral is \(\int \dfrac{du}{u}\).

Answer: \(\log|\log x| + C\).

Q5Evaluate \(\displaystyle\int \frac{x}{\sqrt{1 - x^4}}\,dx\), for \(|x| < 1\).

\(u = x^2\), \(du = 2x\,dx\). The integral is \(\dfrac{1}{2}\int \dfrac{du}{\sqrt{1 - u^2}}\).

Answer: \(\dfrac{1}{2}\sin^{-1}(x^2) + C\).

Q6Evaluate \(\displaystyle\int \frac{\sin 2x}{1 + \sin^2 x}\,dx\).

\(u = 1 + \sin^2 x\), \(du = 2\sin x\cos x\,dx = \sin 2x\,dx\).

\(\int \dfrac{du}{u} = \log(1 + \sin^2 x) + C\). No modulus is needed, because \(1 + \sin^2 x\) is always positive.

Stuck on a question?

Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.

08

Frequently asked questions

What is integration by substitution?

A method where you replace part of the integrand by a new variable \(u\), so that the integral turns into a standard one. It is the chain rule for derivatives used in reverse: \(\int f\big(g(x)\big)g'(x)\,dx = \int f(u)\,du\) with \(u = g(x)\).

How do I know what to substitute?

Look for an inner function whose derivative is also in the integrand, possibly multiplied by a constant. Brackets raised to powers, denominators, exponents and the argument of \(\sin\), \(\cos\) or \(\log\) are the usual candidates. If \(x\) terms are left over after substituting, try another choice.

Do I change the limits in a definite integral?

Yes, if you finish the integral in \(u\). For \(\int_0^2 2x\,e^{x^2}\,dx\) with \(u = x^2\), the limits \(x = 0\) and \(x = 2\) become \(u = 0\) and \(u = 4\), and the answer is \(e^4 - 1\). The definite integration lesson covers this in detail.

What is the integral of tan x?

\(\int \tan x\,dx = \log|\sec x| + C\), which is the same as \(-\log|\cos x| + C\). You get it by writing \(\tan x = \dfrac{\sin x}{\cos x}\) and substituting \(u = \cos x\).

Related lessons

← All integration lessons
Vipul Sir
Written by Vipul Sir

Vipul Sir has taught mathematics for over 15 years to HSC, CBSE, ICSE, IGCSE/IB, Diploma, Engineering and BSc students at VVS Classes in Goregaon and Vile Parle, Mumbai. He teaches every class himself, concepts first and exam technique second.

Class 11 & 12 Maths

Integration gets easier once you can spot the method.

Concept-first classes in small batches in Goregaon and Vile Parle, or online, for HSC, CBSE and ICSE students. Your first class is free.

WhatsApp↗