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

Exercise 7.6 · Q1: ∫xsin⁡x dx\int x\sin x\,dx

Exercise 7.6Integration by parts · Section 7.6
The question

Integrate the functions in Exercises 1 to 22.

1. xsin⁡xx\sin x

Exam answer

Let I=∫xsin⁡x dxI = \displaystyle\int x\sin x\,dx⁠.

Taking xx as the first function, by parts:

I=x(−cos⁡x)−∫1⋅(−cos⁡x) dx=−xcos⁡x+∫cos⁡x dx\begin{aligned} I &= x(-\cos x) - \int 1\cdot(-\cos x)\,dx \\ &= -x\cos x + \int\cos x\,dx \end{aligned}

∴ I=−xcos⁡x+sin⁡x+C\therefore\ I = -x\cos x + \sin x + C⁠.

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

The one idea this problem is built on

The integrand is a product of an algebraic factor xx and a trigonometric factor sin⁡x\sin x⁠, and no standard formula fits it. Integration by parts lets us differentiate one factor and integrate the other. Differentiating xx turns it into 1, so the integral that is left contains only a trigonometric function, which is a standard one.

Given, to find, and the plan
Given
The function xsin⁡xx\sin x⁠, defined and continuous for every real xx⁠.
To find
∫xsin⁡x dx\int x\sin x\,dx⁠, the family of all its antiderivatives.
Plan
(1) Name uu and dvdx\frac{dv}{dx} and explain the choice. (2) Find dudx\frac{du}{dx} and vv⁠. (3) Apply the integration by parts formula. (4) Finish the remaining integral. (5) Differentiate the answer back.

Basics you need

1Integration by parts

Integrating the product rule ddx(uv)=udvdx+vdudx\frac{d}{dx}(uv) = u\frac{dv}{dx} + v\frac{du}{dx} gives Section 7.6, equation (1):

∫u dvdx dx=uv−∫v dudx dx.\int u\,\frac{dv}{dx}\,dx = uv - \int v\,\frac{du}{dx}\,dx.

Here uu is the first function (it gets differentiated) and dvdx\frac{dv}{dx} is the second function (it gets integrated, giving vv⁠). Lesson: integration by parts

2Which factor should be uu⁠?

The book's Remark (iii) after Example 17: a power of xx or a polynomial is usually taken as the first function, unless the other factor is an inverse trigonometric or logarithmic function. A common memory aid (not in the book) is the order ILATE: Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential. The factor whose type comes earlier is taken as uu⁠.

3Two standard integrals

∫sin⁡x dx=−cos⁡x+C\int\sin x\,dx = -\cos x + C and ∫cos⁡x dx=sin⁡x+C\int\cos x\,dx = \sin x + C (standard formulae (iii) and (ii), Section 7.2). Basics: trigonometric functions

4The product rule

(fg)′=f′g+fg′(fg)' = f'g + fg'⁠, used to differentiate the answer back. Basics: integration undoes differentiation

Solution

  1. Name uu and dvdx\frac{dv}{dx}

    Write the integrand as a product of two factors and take

    u=x(first),dvdx=sin⁡x(second).\begin{aligned} u &= x \quad (\text{first}), \\ \frac{dv}{dx} &= \sin x \quad (\text{second}). \end{aligned}
    In ILATE order, xx is Algebraic (A) and sin⁡x\sin x is Trigonometric (T); A comes first, so u=xu = x⁠. The reason behind the rule: differentiating xx gives the constant 1, which removes the troublesome factor, while integrating sin⁡x\sin x only gives −cos⁡x-\cos x⁠, no harder. The opposite choice (u=sin⁡xu = \sin x⁠, dvdx=x\frac{dv}{dx} = x⁠) would integrate xx to x22\frac{x^2}{2} and leave ∫x22cos⁡x dx\int\frac{x^2}{2}\cos x\,dx⁠, which is harder than the question.
    Remark (iii) after Example 17, Section 7.6. Lesson: integration by parts
  2. Find dudx\frac{du}{dx} and vv

    dudx=1,v=∫sin⁡x dx=−cos⁡x.\frac{du}{dx} = 1, \qquad v = \int\sin x\,dx = -\cos x.
    The formula needs the derivative of uu and an integral of dvdx\frac{dv}{dx}⁠. No constant is added to vv⁠: the book's Remark (ii) after Example 17 shows that any constant added here cancels out of the final answer.
    ddxx=1\frac{d}{dx}x = 1⁠; standard formula (iii). Basics: trigonometric functions
  3. Apply the formula

    ∫xsin⁡x dx=uv−∫v dudx dx=x(−cos⁡x)−∫(−cos⁡x)⋅1 dx=−xcos⁡x+∫cos⁡x dx.\begin{aligned} \int x\sin x\,dx &= uv - \int v\,\frac{du}{dx}\,dx \\ &= x(-\cos x) - \int(-\cos x)\cdot 1\,dx \\ &= -x\cos x + \int\cos x\,dx. \end{aligned}
    First function times the integral of the second, minus the integral of (derivative of the first) times (integral of the second). The two minus signs in −∫(−cos⁡x) dx-\int(-\cos x)\,dx multiply to a plus.
    Section 7.6, equation (1). Lesson: integration by parts
  4. Finish the remaining integral

    ∫xsin⁡x dx=−xcos⁡x+sin⁡x+C.\int x\sin x\,dx = -x\cos x + \sin x + C.
    ∫cos⁡x dx=sin⁡x\int\cos x\,dx = \sin x is standard formula (ii). One constant CC is added at the very end, for the whole family of antiderivatives.
    Standard formula (ii), Section 7.2. Basics: trigonometric functions
  5. Check: differentiate the answer

    By the product rule, ddx(xcos⁡x)=cos⁡x−xsin⁡x\frac{d}{dx}(x\cos x) = \cos x - x\sin x⁠. So

    ddx(−xcos⁡x+sin⁡x)=−(cos⁡x−xsin⁡x)+cos⁡x=−cos⁡x+xsin⁡x+cos⁡x=xsin⁡x.\begin{aligned} &\frac{d}{dx}\big(-x\cos x + \sin x\big) \\ &= -(\cos x - x\sin x) + \cos x \\ &= -\cos x + x\sin x + \cos x \\ &= x\sin x. \end{aligned}
    The derivative is exactly the integrand for every real xx⁠, so the answer is right. Integration by parts is the product rule run backwards, so the product rule is the natural check.
    Product rule; ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠. Basics: integration undoes differentiation
Result ∫xsin⁡x dx=−xcos⁡x+sin⁡x+C,\int x\sin x\,dx = -x\cos x + \sin x + C,

valid for every real xx⁠. (Textbook answer: −xcos⁡x+sin⁡x+C-x\cos x + \sin x + C⁠, the same.)

Check it with numbers

With F(x)=−xcos⁡x+sin⁡xF(x) = -x\cos x + \sin x⁠, on the interval [0,π2]\left[0, \frac\pi2\right]⁠:

F(π2)−F(0)=(−π2⋅0+1)−(0+0)=1.\begin{aligned} F\left(\tfrac\pi2\right) - F(0) &= \left(-\tfrac\pi2\cdot 0 + 1\right) - (0 + 0) \\ &= 1. \end{aligned}

Numerical integration of xsin⁡xx\sin x over [0,π2]\left[0, \frac\pi2\right] (adding up very thin strips) gives 1.00000000001.0000000000⁠, the same.

Common mistakes
  1. Sign of vv⁠. ∫sin⁡x dx=−cos⁡x\int\sin x\,dx = -\cos x⁠, not +cos⁡x+\cos x⁠. Losing this minus changes the answer to xcos⁡x−sin⁡xx\cos x - \sin x⁠, whose derivative is −xsin⁡x-x\sin x⁠.
  2. Choosing u=sin⁡xu = \sin x⁠. The new integral then contains x2x^2 and is harder (Step 1).
  3. Multiplying integrals. ∫xsin⁡x dx\int x\sin x\,dx is not ∫x dx⋅∫sin⁡x dx\int x\,dx\cdot\int\sin x\,dx⁠.
What to take away
  1. For xx times a sine or cosine, take u=xu = x⁠: one use of the formula removes the xx⁠.
  2. Write uu⁠, dvdx\frac{dv}{dx}⁠, dudx\frac{du}{dx} and vv down before using the formula; most errors are sign errors in vv⁠.
  3. One constant CC at the end is enough.

Every fact used, and where it comes from

FactUsed inSource
Integration by parts, ∫udvdxdx=uv−∫vdudxdx\int u\frac{dv}{dx}dx = uv - \int v\frac{du}{dx}dxStep 3Section 7.6, equation (1) (Lesson: integration by parts)
Choice of the first function (ILATE)Step 1Remark (iii) after Example 17, Section 7.6; same choice as Example 17
No constant needed in vvStep 2Remark (ii) after Example 17, Section 7.6
∫sin⁡x dx=−cos⁡x+C\int\sin x\,dx = -\cos x + C⁠, ∫cos⁡x dx=sin⁡x+C\int\cos x\,dx = \sin x + CSteps 2, 4Standard formulae (iii), (ii), Section 7.2
Product ruleStep 5Chapter 5, Section 5.3
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 →