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

Exercise 7.6 · Q14: ∫x(log⁡x)2 dx\int x(\log x)^2\,dx

Exercise 7.6Integration by parts · Section 7.6
The question

Integrate the functions in Exercises 1 to 22.

14.

x (log⁡x)2x\,(\log x)^2
Exam answer

Let I=∫x(log⁡x)2 dxI = \displaystyle\int x(\log x)^2\,dx⁠.

Taking (log⁡x)2(\log x)^2 as the first function, by parts:

I=(log⁡x)2⋅x22−∫2log⁡xx⋅x22 dx=x22(log⁡x)2−∫xlog⁡x dx\begin{aligned} I &= (\log x)^2\cdot\frac{x^2}{2} \\ &\quad - \int\frac{2\log x}{x}\cdot\frac{x^2}{2}\,dx \\ &= \frac{x^2}{2}(\log x)^2 - \int x\log x\,dx \end{aligned}

Again by parts, taking log⁡x\log x as the first function:

∫xlog⁡x dx=log⁡x⋅x22−∫1x⋅x22 dx=x22log⁡x−x24\begin{aligned} &\int x\log x\,dx \\ &= \log x\cdot\frac{x^2}{2} - \int\frac1x\cdot\frac{x^2}{2}\,dx \\ &= \frac{x^2}{2}\log x - \frac{x^2}{4} \end{aligned} ∴ I=x22(log⁡x)2−(x22log⁡x−x24)+C\begin{aligned} \therefore\ I &= \frac{x^2}{2}(\log x)^2 \\ &\quad - \left(\frac{x^2}{2}\log x - \frac{x^2}{4}\right) + C \end{aligned}

∴ I=x22(log⁡x)2−x22log⁡x\therefore\ I = \dfrac{x^2}{2}(\log x)^2 - \dfrac{x^2}{2}\log x +x24+C+ \dfrac{x^2}{4} + C⁠.

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

The one idea this problem is built on

Integrating by parts with (log⁡x)2(\log x)^2 as the first function replaces it by its derivative 2log⁡xx\frac{2\log x}{x}⁠: the power of the logarithm drops from 2 to 1, and the 1x\frac1x cancels against the x2x^2 that comes from integrating xx⁠. One more round of parts removes the last logarithm. Each round lowers the power of log⁡x\log x by one.

Given, to find, and the plan
Given
x(log⁡x)2x(\log x)^2⁠, defined for x>0x > 0 (where log⁡x\log x is defined).
To find
∫x(log⁡x)2 dx\int x(\log x)^2\,dx⁠.
Plan
(1) Choose (log⁡x)2(\log x)^2 first, xx second. (2) Apply parts; the new integral is ∫xlog⁡x dx\int x\log x\,dx⁠. (3) Integrate that by parts. (4) Combine. (5) Differentiate back.

Basics you need

1Integration by parts

∫fg dx=f∫g dx−∫[f′∫g dx]dx\int f g\,dx = f\int g\,dx - \int\big[f'\int g\,dx\big]dx (Section 7.6). Lesson: integration by parts

2Derivative of log⁡x\log x and the chain rule

ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0⁠, so ddx(log⁡x)2=2log⁡x⋅1x\frac{d}{dx}(\log x)^2 = 2\log x\cdot\frac1x⁠. Basics: logarithms and 1/x

3Power rule

∫xn dx=xn+1n+1+C\int x^n\,dx = \frac{x^{n+1}}{n+1} + C for n≠−1n \ne -1 (standard formula (i)). Basics: powers of x

Solution

  1. Choose the first and second functions

    Take

    f(x)=(log⁡x)2 (first),g(x)=x (second).f(x) = (\log x)^2\ (\text{first}),\qquad g(x) = x\ (\text{second}).

    Then, by the chain rule, f′(x)=2log⁡xxf'(x) = \frac{2\log x}{x}⁠, and ∫x dx=x22\int x\,dx = \frac{x^2}{2}⁠.

    We cannot integrate (log⁡x)2(\log x)^2 directly, so it cannot be the second function. Differentiating it, on the other hand, lowers the power of the logarithm. This matches Remark (iii) in Section 7.6: a logarithmic function is taken as the first function even when the other factor is a power of xx⁠. (A common memory aid, not in the book, is ILATE: Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential. L comes before A, so (log⁡x)2(\log x)^2 is uu and xx is dvdx\frac{dv}{dx}⁠.)
    ddx(log⁡x)2=2(log⁡x)⋅1x\frac{d}{dx}(\log x)^2 = 2(\log x)\cdot\frac1x (chain rule, Section 5.3.1). Basics: logarithms and 1/x
  2. First round of integration by parts

    ∫x(log⁡x)2 dx=(log⁡x)2⋅x22−∫2log⁡xx⋅x22 dx=x22(log⁡x)2−∫xlog⁡x dx.\begin{aligned} \int x(\log x)^2\,dx &= (\log x)^2\cdot\frac{x^2}{2} - \int\frac{2\log x}{x}\cdot\frac{x^2}{2}\,dx \\ &= \frac{x^2}{2}(\log x)^2 - \int x\log x\,dx. \end{aligned}
    Inside the new integral, 2x⋅x22=x\frac{2}{x}\cdot\frac{x^2}{2} = x⁠, so the logarithm now appears only to the first power. That is progress: ∫xlog⁡x dx\int x\log x\,dx is Exercise 7.6 Question 4.
    Parts formula with f=(log⁡x)2f = (\log x)^2⁠, g=xg = x⁠. Lesson: integration by parts
  3. Second round: ∫xlog⁡x dx\int x\log x\,dx

    Again take the logarithm as the first function: log⁡x\log x first, xx second. Then the derivative of the first is 1x\frac1x and the integral of the second is x22\frac{x^2}{2}⁠:

    ∫xlog⁡x dx=log⁡x⋅x22−∫1x⋅x22 dx=x22log⁡x−∫x2 dx=x22log⁡x−x24.\begin{aligned} \int x\log x\,dx &= \log x\cdot\frac{x^2}{2} - \int\frac1x\cdot\frac{x^2}{2}\,dx \\ &= \frac{x^2}{2}\log x - \int\frac{x}{2}\,dx \\ &= \frac{x^2}{2}\log x - \frac{x^2}{4}. \end{aligned}
    Same reasoning as in Step 1. After this round no logarithm is left inside the integral, and ∫x2 dx=x24\int\frac x2\,dx = \frac{x^2}{4} by the power rule.
    ∫x dx=x22\int x\,dx = \frac{x^2}{2} (formula (i)). Basics: powers of x
  4. Combine

    Substitute Step 3 into Step 2, taking care with the minus sign in front of the bracket:

    ∫x(log⁡x)2 dx=x22(log⁡x)2−[x22log⁡x−x24]=x22(log⁡x)2−x22log⁡x+x24+C,\begin{aligned} \int x(\log x)^2\,dx &= \frac{x^2}{2}(\log x)^2 - \left[\frac{x^2}{2}\log x - \frac{x^2}{4}\right] \\ &= \frac{x^2}{2}(\log x)^2 - \frac{x^2}{2}\log x + \frac{x^2}{4} + C, \end{aligned}

    for x>0x > 0⁠.

    The minus in front of the bracket changes −x24-\frac{x^2}{4} into +x24+\frac{x^2}{4}⁠. The answer is valid for x>0x > 0⁠, the domain of log⁡x\log x⁠.
    Antiderivatives differ by a constant: one CC at the end (Section 7.2). Basics: integration undoes differentiation
  5. Check: differentiate the answer

    Differentiate the three terms separately (product rule on each):

    ddx[x22(log⁡x)2]=x(log⁡x)2+xlog⁡x,ddx[−x22log⁡x]=−xlog⁡x−x2,ddx[x24]=x2.\begin{aligned} \frac{d}{dx}\left[\frac{x^2}{2}(\log x)^2\right] &= x(\log x)^2 + x\log x, \\ \frac{d}{dx}\left[-\frac{x^2}{2}\log x\right] &= -x\log x - \frac{x}{2}, \\ \frac{d}{dx}\left[\frac{x^2}{4}\right] &= \frac{x}{2}. \end{aligned}

    Adding, the xlog⁡xx\log x terms cancel and the x2\frac x2 terms cancel, leaving x(log⁡x)2x(\log x)^2⁠, the integrand, for every x>0x > 0⁠.

    First line: x⋅(log⁡x)2+x22⋅2log⁡xxx\cdot(\log x)^2 + \frac{x^2}{2}\cdot\frac{2\log x}{x}⁠. Second line: −(xlog⁡x+x22⋅1x)-\big(x\log x + \frac{x^2}{2}\cdot\frac1x\big)⁠.
    Product rule; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠. Basics: integration undoes differentiation
Result ∫x(log⁡x)2 dx=x22(log⁡x)2−x22log⁡x+x24+C,\begin{aligned} &\int x(\log x)^2\,dx \\ &= \frac{x^2}{2}(\log x)^2 - \frac{x^2}{2}\log x + \frac{x^2}{4} + C, \end{aligned}

valid for x>0x > 0⁠. (Textbook answer: x22(log⁡x)2−x22log⁡x+x24+C\frac{x^2}{2}(\log x)^2 - \frac{x^2}{2}\log x + \frac{x^2}{4} + C⁠, the same.)

Check it with numbers

On [1,e][1, e]⁠, with FF the answer without CC⁠: log⁡e=1\log e = 1 and log⁡1=0\log 1 = 0⁠, so

F(e)−F(1)=(e22−e22+e24)−14=e2−14=1.5972640247…\begin{aligned} F(e) - F(1) &= \left(\frac{e^2}{2} - \frac{e^2}{2} + \frac{e^2}{4}\right) - \frac14 \\ &= \frac{e^2 - 1}{4} = 1.5972640247\ldots \end{aligned}

Numerical integration of x(log⁡x)2x(\log x)^2 over [1,e][1, e] gives 1.5972640247…1.5972640247\ldots⁠, the same.

Common mistakes
  1. Taking xx as the first function. Then the second function (log⁡x)2(\log x)^2 has to be integrated, which is harder than the original problem.
  2. Forgetting the chain rule: ddx(log⁡x)2\frac{d}{dx}(\log x)^2 is 2log⁡xx\frac{2\log x}{x}⁠, not 2x\frac{2}{x} or 2log⁡x2\log x⁠.
  3. Sign slip when combining. −[x22log⁡x−x24]=−x22log⁡x+x24-\big[\frac{x^2}{2}\log x - \frac{x^2}{4}\big] = -\frac{x^2}{2}\log x + \frac{x^2}{4}⁠.
What to take away
  1. For xm(log⁡x)kx^m(\log x)^k⁠, keep the logarithm as the first function; each round of parts lowers kk by one.
  2. Reuse earlier results: the second round here is exactly Exercise 7.6 Question 4.

Every fact used, and where it comes from

FactUsed inSource
Integration by partsSteps 2, 3Section 7.6 (Lesson: integration by parts)
Logarithmic function taken as the first functionSteps 1, 3Remark (iii), Section 7.6
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0⁠; chain ruleSteps 1, 3, 5Chapter 5, Sections 5.4 and 5.3.1
∫xn dx=xn+1n+1+C\int x^n\,dx = \frac{x^{n+1}}{n+1} + CSteps 1, 3Standard formula (i), 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 →