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

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

Exercise 7.6Integration by parts · Section 7.6
The question

Integrate the functions in Exercises 1 to 22.

2. xsin⁡3xx\sin 3x

Exam answer

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

Taking xx as the first function, by parts:

I=x(−cos⁡3x3)−∫1⋅(−cos⁡3x3)dx=−x3cos⁡3x+13∫cos⁡3x dx=−x3cos⁡3x+13⋅sin⁡3x3+C\begin{aligned} I &= x\left(-\frac{\cos 3x}{3}\right) \\ &\quad - \int 1\cdot\left(-\frac{\cos 3x}{3}\right)dx \\ &= -\frac x3\cos 3x + \frac13\int\cos 3x\,dx \\ &= -\frac x3\cos 3x + \frac13\cdot\frac{\sin 3x}{3} + C \end{aligned}

∴ I=−x3cos⁡3x+19sin⁡3x+C\therefore\ I = -\dfrac x3\cos 3x + \dfrac19\sin 3x + C⁠.

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

The one idea this problem is built on

This is Question 1 with 3x3x in place of xx inside the sine. The method is the same: integration by parts with u=xu = x⁠, so that differentiating xx removes it. The only new point is the factor 13\frac13 that appears every time we integrate a sine or cosine of 3x3x⁠, and it appears twice, giving 19\frac19 in the last term.

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

Basics you need

1Integration by parts

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,

with uu the first function (differentiated) and dvdx\frac{dv}{dx} the second (integrated to give vv⁠). Lesson: integration by parts

2Which factor should be uu⁠?

Remark (iii) after Example 17: a power of xx is usually the first function. The memory aid ILATE (Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential; not in the book) says the same: Algebraic comes before Trigonometric.

3Sine and cosine of 3x3x

With t=3xt = 3x⁠, dt=3 dxdt = 3\,dx⁠:

∫sin⁡3x dx=−13cos⁡3x+C,∫cos⁡3x dx=13sin⁡3x+C.\begin{aligned} \int\sin 3x\,dx &= -\tfrac13\cos 3x + C, \\ \int\cos 3x\,dx &= \tfrac13\sin 3x + C. \end{aligned}

(Substitution, Section 7.3.1, with standard formulae (iii) and (ii).) Basics: substitution

4Product and chain rules

For the check: (fg)′=f′g+fg′(fg)' = f'g + fg' and ddxcos⁡3x=−3sin⁡3x\frac{d}{dx}\cos 3x = -3\sin 3x⁠. Basics: integration undoes differentiation

Solution

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

    u=x(first),dvdx=sin⁡3x(second).\begin{aligned} u &= x \quad (\text{first}), \\ \frac{dv}{dx} &= \sin 3x \quad (\text{second}). \end{aligned}
    ILATE: xx is Algebraic, sin⁡3x\sin 3x is Trigonometric, and A comes before T. Differentiating xx gives 1, which removes it; integrating sin⁡3x\sin 3x gives another trigonometric function of the same kind, no harder. With the opposite choice the power of xx would go up to x2x^2⁠.
    Remark (iii) after Example 17, Section 7.6. Lesson: integration by parts
  2. Find dudx\frac{du}{dx} and vv

    dudx=1\frac{du}{dx} = 1⁠. For vv⁠, put t=3xt = 3x⁠, so dt=3 dxdt = 3\,dx and dx=13 dtdx = \frac13\,dt⁠:

    v=∫sin⁡3x dx=13∫sin⁡t dt=−13cos⁡t=−13cos⁡3x.\begin{aligned} v &= \int\sin 3x\,dx = \frac13\int\sin t\,dt \\ &= -\frac13\cos t = -\frac13\cos 3x. \end{aligned}
    The substitution turns sin⁡3x\sin 3x into the standard sin⁡t\sin t⁠; the factor 13\frac13 comes from dx=13 dtdx = \frac13\,dt⁠. (Quick test: ddx(−13cos⁡3x)\frac{d}{dx}\left(-\frac13\cos 3x\right) =−13⋅(−3sin⁡3x)=sin⁡3x= -\frac13\cdot(-3\sin 3x) = \sin 3x⁠.) No constant is added to vv (Remark (ii) after Example 17).
    Substitution, Section 7.3.1; standard formula (iii). Basics: substitution
  3. Apply the formula

    ∫xsin⁡3x dx=uv−∫v dudx dx=x(−13cos⁡3x)−∫(−13cos⁡3x)dx=−x3cos⁡3x+13∫cos⁡3x dx.\begin{aligned} \int x\sin 3x\,dx &= uv - \int v\,\frac{du}{dx}\,dx \\ &= x\left(-\frac13\cos 3x\right) - \int\left(-\frac13\cos 3x\right)dx \\ &= -\frac x3\cos 3x + \frac13\int\cos 3x\,dx. \end{aligned}
    First function times integral of the second, minus the integral of (derivative of first) times (integral of second). The constant −13-\frac13 comes out of the integral, and minus times minus gives plus.
    Section 7.6, equation (1); constant multiple rule (Section 7.2.1). Lesson: integration by parts
  4. Finish the remaining integral

    By the same substitution, ∫cos⁡3x dx=13sin⁡3x\int\cos 3x\,dx = \frac13\sin 3x⁠. So

    ∫xsin⁡3x dx=−x3cos⁡3x+13⋅13sin⁡3x+C=−x3cos⁡3x+19sin⁡3x+C.\begin{aligned} \int x\sin 3x\,dx &= -\frac x3\cos 3x + \frac13\cdot\frac13\sin 3x + C \\ &= -\frac x3\cos 3x + \frac19\sin 3x + C. \end{aligned}
    Each integration of a sine or cosine of 3x3x brings a factor 13\frac13⁠. The last term was integrated twice (once for vv⁠, once now), so it carries 13⋅13=19\frac13\cdot\frac13 = \frac19⁠.
    Substitution t=3xt = 3x⁠; standard formula (ii). Basics: substitution
  5. Check: differentiate the answer

    Product rule on the first term, chain rule on both:

    ddx(−x3cos⁡3x+19sin⁡3x)=−13cos⁡3x−x3(−3sin⁡3x)+39cos⁡3x=−13cos⁡3x+xsin⁡3x+13cos⁡3x=xsin⁡3x.\begin{aligned} &\frac{d}{dx}\Big(-\frac x3\cos 3x + \frac19\sin 3x\Big) \\ &= -\frac13\cos 3x - \frac x3(-3\sin 3x) + \frac39\cos 3x \\ &= -\frac13\cos 3x + x\sin 3x + \frac13\cos 3x \\ &= x\sin 3x. \end{aligned}
    The two cosine terms cancel and exactly the integrand remains, for every real xx⁠.
    Product rule and chain rule (Chapter 5). Basics: integration undoes differentiation
Result ∫xsin⁡3x dx=−x3cos⁡3x+19sin⁡3x+C,\int x\sin 3x\,dx = -\frac{x}{3}\cos 3x + \frac19\sin 3x + C,

valid for every real xx⁠. (Textbook answer: −x3cos⁡3x+19sin⁡3x+C-\frac{x}{3}\cos 3x + \frac19\sin 3x + C⁠, the same.)

Check it with numbers

With F(x)=−x3cos⁡3x+19sin⁡3xF(x) = -\frac x3\cos 3x + \frac19\sin 3x⁠, on [0,π3]\left[0, \frac\pi3\right]⁠, where cos⁡π=−1\cos\pi = -1 and sin⁡π=0\sin\pi = 0⁠:

F(π3)−F(0)=−π9(−1)+0−0=π9=0.3490658504…\begin{aligned} F\left(\tfrac\pi3\right) - F(0) &= -\frac{\pi}{9}(-1) + 0 - 0 \\ &= \frac{\pi}{9} = 0.3490658504\ldots \end{aligned}

Numerical integration of xsin⁡3xx\sin 3x over [0,π3]\left[0, \frac\pi3\right] gives 0.3490658504…0.3490658504\ldots⁠, the same.

Common mistakes
  1. Forgetting the 13\frac13⁠. ∫sin⁡3x dx=−13cos⁡3x\int\sin 3x\,dx = -\frac13\cos 3x⁠, not −cos⁡3x-\cos 3x⁠.
  2. Only one factor 13\frac13 in the last term. The last term needs 19\frac19⁠, because it has been integrated twice.
  3. Multiplying by 3 instead of dividing. Differentiating cos⁡3x\cos 3x multiplies by 3; integrating divides by 3.
What to take away
  1. The same steps give, for any a≠0a \ne 0⁠, ∫xsin⁡ax dx=−xacos⁡ax+1a2sin⁡ax+C.\int x\sin ax\,dx = -\frac xa\cos ax + \frac{1}{a^2}\sin ax + C. Question 1 is the case a=1a = 1⁠.
  2. When integrating sin⁡ax\sin ax or cos⁡ax\cos ax⁠, divide by aa every time.
  3. Always test vv by differentiating it before using it in the formula.

Every fact used, and where it comes from

FactUsed inSource
Integration by partsStep 3Section 7.6, equation (1) (Lesson: integration by parts)
Choice of the first function (ILATE)Step 1Remark (iii) after Example 17, Section 7.6
No constant needed in vvStep 2Remark (ii) after Example 17, Section 7.6
Substitution t=3xt = 3xSteps 2, 4Section 7.3.1 (Lesson: substitution)
∫sin⁡t dt=−cos⁡t+C\int\sin t\,dt = -\cos t + C⁠, ∫cos⁡t dt=sin⁡t+C\int\cos t\,dt = \sin t + CSteps 2, 4Standard formulae (iii), (ii), Section 7.2
Constant multiple ruleStep 3Property (IV), Section 7.2.1
Product and chain rulesStep 5Chapter 5, Sections 5.3 and 5.3.1
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 →