Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 1: Anti derivatives of cos⁡2x\cos 2x⁠, 3x2+4x33x^2 + 4x^3 and 1x\frac{1}{x} by inspection

ExamplesIntegration as anti-differentiation · Section 7.2
The question

Write an anti derivative for each of the following functions using the method of inspection:

(i) cos⁡2x\cos 2x    (ii) 3x2+4x33x^2 + 4x^3    (iii) 1x, x≠0\dfrac{1}{x},\ x \ne 0

Exam answer

(i) We know ddx(sin⁡2x)=2cos⁡2x\frac{d}{dx}(\sin 2x) = 2\cos 2x⁠.

∴ cos⁡2x=12 ddx(sin⁡2x)=ddx(12sin⁡2x)\begin{aligned} \therefore\ \cos 2x &= \frac12\,\frac{d}{dx}(\sin 2x) \\ &= \frac{d}{dx}\left(\frac12\sin 2x\right) \end{aligned}

So an anti derivative of cos⁡2x\cos 2x is 12sin⁡2x\frac12\sin 2x⁠.

(ii) We know

ddx(x3+x4)=3x2+4x3\frac{d}{dx}(x^3 + x^4) = 3x^2 + 4x^3

So an anti derivative of 3x2+4x33x^2 + 4x^3 is x3+x4x^3 + x^4⁠.

(iii) We know

ddx(log⁡x)=1x, x>0\frac{d}{dx}(\log x) = \frac1x,\ x > 0 ddx[log⁡(−x)]=1−x⋅(−1)=1x, x<0\begin{aligned} \frac{d}{dx}[\log(-x)] &= \frac{1}{-x}\cdot(-1) \\ &= \frac1x,\ x < 0 \end{aligned}

Combining these, ddx(log⁡∣x∣)=1x\frac{d}{dx}(\log|x|) = \frac1x⁠, x≠0x \ne 0⁠.

So an anti derivative of 1x\dfrac1x is log⁡∣x∣\log|x|⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

An anti derivative of ff is any function FF with F′(x)=f(x)F'(x) = f(x)⁠. "Inspection" means we do not use a formula for integrals at all: we run through derivatives we already know, find one that produces ff (or a constant multiple of it), and then adjust the constant. Every answer can be checked by differentiating it, and that check is the whole definition of being right.

Given, to find, and the plan
Given
(i) f(x)=cos⁡2xf(x) = \cos 2x⁠, all real xx⁠; (ii) f(x)=3x2+4x3f(x) = 3x^2 + 4x^3⁠, all real xx⁠; (iii) f(x)=1xf(x) = \frac1x⁠, x≠0x \ne 0⁠.
To find
One function FF in each case with F′(x)=f(x)F'(x) = f(x) wherever ff is defined.
Plan
For each part: recall a derivative that "looks like" ff⁠; fix the constant factor; then differentiate the guess to confirm it. In part (iii) treat x>0x > 0 and x<0x < 0 separately, because log⁡x\log x only exists for x>0x > 0⁠.

Basics you need

1What an anti derivative is

FF is an anti derivative (or an integral) of ff on an interval when ddxF(x)=f(x)\frac{d}{dx}F(x) = f(x) at every point of it. If FF is one, so is F+CF + C for every constant CC⁠, since a constant has derivative 0. Basics: integration undoes differentiation

2Derivatives you will reuse

ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠, ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}⁠, ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0⁠. Basics: powers of x and the power rule

3The chain rule

ddxg(u(x))=g′(u(x))⋅u′(x)\frac{d}{dx}g(u(x)) = g'(u(x))\cdot u'(x)⁠. For example ddxsin⁡2x=cos⁡2x⋅2\frac{d}{dx}\sin 2x = \cos 2x \cdot 2⁠. This is where the factor 2 in part (i) comes from. Basics: substitution, the chain rule backwards

4The modulus

∣x∣=x|x| = x when x>0x > 0 and ∣x∣=−x|x| = -x when x<0x < 0⁠. So log⁡∣x∣\log|x| is defined for every x≠0x \ne 0⁠. Basics: logarithms and 1/x

Part (i): an anti derivative of cos⁡2x\cos 2x

  1. Find a derivative that produces cos⁡2x\cos 2x

    The function whose derivative is a cosine is a sine. Try sin⁡2x\sin 2x⁠. By the chain rule (inner u=2xu = 2x⁠, outer sin⁡u\sin u⁠):

    ddxsin⁡2x=cos⁡2x⋅ddx(2x)=2cos⁡2x.\frac{d}{dx}\sin 2x = \cos 2x \cdot \frac{d}{dx}(2x) = 2\cos 2x.
    This is the method of inspection: we search our memory of derivatives for one whose result has the right shape. sin⁡2x\sin 2x gives the right function, cos⁡2x\cos 2x⁠, but with an unwanted factor 2 produced by the inner function 2x2x⁠.
    Standard formula (ii) of Section 7.2: ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠; chain rule from Chapter 5. Basics: the chain rule backwards
  2. Remove the extra factor 2

    Divide both sides by 2. A constant factor can be moved inside the derivative:

    cos⁡2x=12 ddx(sin⁡2x)=ddx(12sin⁡2x).\cos 2x = \frac12\,\frac{d}{dx}(\sin 2x) = \frac{d}{dx}\left(\frac12 \sin 2x\right).

    So an anti derivative of cos⁡2x\cos 2x is 12sin⁡2x\frac12\sin 2x.

    ddx(kF)=kddxF\frac{d}{dx}(kF) = k\frac{d}{dx}F for any constant kk⁠. Halving the guess halves its derivative, which turns 2cos⁡2x2\cos 2x into exactly cos⁡2x\cos 2x⁠.
    Constant multiple rule for derivatives. Basics: integration undoes differentiation
  3. Check: differentiate the answer

    ddx(12sin⁡2x)=12⋅2cos⁡2x=cos⁡2x. ✓\frac{d}{dx}\left(\frac12\sin 2x\right) = \frac12\cdot 2\cos 2x = \cos 2x. \ \checkmark

    This holds for every real xx⁠. Adding any constant also gives an anti derivative, so the full family is ∫cos⁡2x dx=12sin⁡2x+C\int\cos 2x\,dx = \frac12\sin 2x + C⁠.

    An anti derivative is defined by its derivative, so differentiating the answer is a complete check, not just a spot test.

Part (ii): an anti derivative of 3x2+4x33x^2 + 4x^3

  1. Recognise each term as a derivative

    By the power rule ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}⁠:

    ddxx3=3x2,ddxx4=4x3.\frac{d}{dx}x^3 = 3x^2, \qquad \frac{d}{dx}x^4 = 4x^3.
    Each term already carries the "right" coefficient: 3x23x^2 is exactly what x3x^3 differentiates to, and 4x34x^3 is exactly what x4x^4 differentiates to. No adjustment of constants is needed.
    Standard formula (i) of Section 7.2. Basics: powers of x and the power rule
  2. Add them

    The derivative of a sum is the sum of the derivatives, so

    ddx(x3+x4)=3x2+4x3.\frac{d}{dx}\left(x^3 + x^4\right) = 3x^2 + 4x^3.

    So an anti derivative of 3x2+4x33x^2 + 4x^3 is x3+x4x^3 + x^4, for every real xx⁠.

    Because differentiation works term by term, we may find an anti derivative of each term separately and add them. For integrals this is Property (III) of Section 7.2.1, proved just before this example.
  3. Check: differentiate the answer

    ddx(x3+x4)=3x2+4x3. ✓\frac{d}{dx}(x^3 + x^4) = 3x^2 + 4x^3. \ \checkmark

    The full family is x3+x4+Cx^3 + x^4 + C⁠.

    Part (ii), Step 2 was already this check written the other way round; repeating it as the last step makes the habit explicit.

Part (iii): an anti derivative of 1x\frac1x⁠, x≠0x \ne 0

  1. The positive side, x>0x > 0

    We know

    ddx(log⁡x)=1x,x>0.\frac{d}{dx}(\log x) = \frac1x, \qquad x > 0.

    So on x>0x > 0⁠, log⁡x\log x is an anti derivative of 1x\frac1x⁠.

    The power rule cannot help here: 1x=x−1\frac1x = x^{-1}⁠, and xn+1n+1\frac{x^{n+1}}{n+1} with n=−1n = -1 would divide by zero. That is why formula (i) excludes n=−1n = -1⁠, and why the logarithm is needed.
    Derivative of log⁡x\log x (Chapter 5, Theorem 5). Basics: logarithms and 1/x
  2. The negative side, x<0x < 0

    For x<0x < 0⁠, log⁡x\log x does not exist, but −x>0-x > 0⁠, so log⁡(−x)\log(-x) does. By the chain rule (inner u=−xu = -x⁠, outer log⁡u\log u⁠):

    ddxlog⁡(−x)=1−x⋅ddx(−x)=1−x⋅(−1)=1x,x<0.\begin{aligned} \frac{d}{dx}\log(-x) &= \frac{1}{-x}\cdot\frac{d}{dx}(-x) \\ &= \frac{1}{-x}\cdot(-1) = \frac1x, \quad x < 0. \end{aligned}
    The question allows every x≠0x \ne 0⁠, including negative xx⁠, so an answer that only works for x>0x > 0 would be incomplete. The two minus signs cancel, so log⁡(−x)\log(-x) has exactly the derivative we want on the negative side.
  3. Combine the two sides with ∣x∣|x|

    Since ∣x∣=x|x| = x for x>0x > 0 and ∣x∣=−x|x| = -x for x<0x < 0⁠, Part (iii), Steps 1 and 2 say together

    ddxlog⁡∣x∣=1x,x≠0.\frac{d}{dx}\log|x| = \frac1x, \qquad x \ne 0.

    So ∫1x dx=log⁡∣x∣\int \frac1x\,dx = \log|x| is an anti derivative of 1x\frac1x, valid on x>0x > 0 and on x<0x < 0⁠.

    One formula, log⁡∣x∣\log|x|⁠, covers both sides: it equals log⁡x\log x on the right of 0 and log⁡(−x)\log(-x) on the left. This is standard formula (xii) of Section 7.2, which the book now proves.
    Standard formula (xii), Section 7.2. Basics: logarithms and 1/x
  4. Check: differentiate the answer at a negative and a positive point

    At x=−2x = -2⁠: log⁡∣x∣=log⁡(−x)\log|x| = \log(-x) near −2-2⁠, and its derivative is 1−2\frac{1}{-2}⁠, the value of 1x\frac1x there. At x=3x = 3⁠: the derivative of log⁡x\log x is 13\frac13⁠. Both match 1x\frac1x⁠. ✓\checkmark

    The family of anti derivatives is written log⁡∣x∣+C\log|x| + C⁠. (Strictly, because x=0x = 0 splits the domain into two separate intervals, the constant may even be different on the two sides. The book does not discuss this, but its Note after the formula list reminds us that the interval on which a function is defined must be kept in mind.)

    The general statement in Part (iii), Step 3 already is the check; testing one point on each side shows concretely that both branches are needed and both work.
Result

(i) An anti derivative of cos⁡2x\cos 2x is 12sin⁡2x\frac12\sin 2x⁠, for all real xx⁠.

(ii) An anti derivative of 3x2+4x33x^2 + 4x^3 is x3+x4x^3 + x^4⁠, for all real xx⁠.

(iii) An anti derivative of 1x\frac1x is log⁡∣x∣\log|x|⁠, for x≠0x \ne 0⁠.

Adding any constant CC gives another anti derivative in each case. This agrees with the textbook's solution.

Check it with numbers

Section 7.8 will show that ∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a) for any anti derivative FF⁠. A computer can find the left side by adding up very many thin strips, without knowing FF⁠, so comparing the two sides is an independent check:

PartIntervalSum of thin stripsF(b)−F(a)F(b) - F(a)
(i)[0,1][0, 1]0.45464870.454648712sin⁡2≈0.4546487\frac12\sin 2 \approx 0.4546487
(ii)[0,1][0, 1]22(1+1)−0=2(1 + 1) - 0 = 2
(iii)[−3,−1][-3, -1]−1.0986123-1.0986123log⁡1−log⁡3≈−1.0986123\log 1 - \log 3 \approx -1.0986123

Part (iii) was tested on negative numbers on purpose: log⁡x\log x would not even be defined there, but log⁡∣x∣\log|x| gives the right value.

Common mistakes
  1. Writing sin⁡2x\sin 2x for part (i). Its derivative is 2cos⁡2x2\cos 2x⁠, twice too big. The inner function 2x2x contributes a factor 2 when differentiating, so integrating must divide by 2.
  2. Using the power rule on 1x\frac1x⁠. x00\frac{x^{0}}{0} is meaningless; n=−1n = -1 is exactly the excluded case of formula (i).
  3. Writing log⁡x\log x for part (iii). That only works for x>0x > 0⁠. The question allows all x≠0x \ne 0⁠, and log⁡∣x∣\log|x| is needed for negative xx⁠.
  4. Thinking the answer is unique. The question asks for an anti derivative; x3+x4+7x^3 + x^4 + 7 is just as correct as x3+x4x^3 + x^4⁠.
What to take away
  1. Integration by inspection: guess from a known derivative, fix the constant factor, check by differentiating.
  2. If the inside of a function is axax (here 2x2x⁠), the anti derivative carries a factor 1a\frac1a⁠.
  3. ∫1x dx=log⁡∣x∣+C\int\frac1x\,dx = \log|x| + C⁠, with the modulus, because the integrand lives on both sides of 0.

Every fact used, and where it comes from

FactUsed inSource
Anti derivative: F′=fF' = f⁠; F+CF + C also worksAll partsSection 7.2 (Lesson: integration as anti-differentiation)
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos xPart (i), Step 1Standard formula (ii), Section 7.2
ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}Part (ii), Step 1Standard formula (i), Section 7.2
Chain rulePart (i), Step 1; Part (iii), Step 2Theorem 4, Section 5.3.1 (Basics: the chain rule backwards)
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠, x>0x > 0Part (iii), Step 1Theorem 5, Section 5.4
ddxlog⁡∣x∣=1x\frac{d}{dx}\log|x| = \frac1x⁠, x≠0x \ne 0Part (iii), Step 3Standard formula (xii), Section 7.2; proved in Example 1
Constant multiple and sum rules for derivativesPart (i), Step 2; Part (ii), Step 2Chapter 5, Section 5.3 (algebra of derivatives)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →