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

Exercise 7.6 · Q4: ∫xlog⁡x dx\int x\log x\,dx

Exercise 7.6Integration by parts · Section 7.6
The question

Integrate the functions in Exercises 1 to 22.

4. xlog⁡xx\log x

Exam answer

Let I=∫xlog⁡x dxI = \displaystyle\int x\log x\,dx⁠.

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

I=log⁡x⋅x22−∫1x⋅x22 dx=x22log⁡x−12∫x dx=x22log⁡x−12⋅x22+C\begin{aligned} I &= \log x\cdot\frac{x^2}{2} - \int\frac1x\cdot\frac{x^2}{2}\,dx \\ &= \frac{x^2}{2}\log x - \frac12\int x\,dx \\ &= \frac{x^2}{2}\log x - \frac12\cdot\frac{x^2}{2} + C \end{aligned}

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

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

The one idea this problem is built on

Here the usual "power of xx first" rule is reversed. We have no formula yet for ∫log⁡x dx\int\log x\,dx in a product, but the derivative of log⁡x\log x is the simple algebraic function 1x\frac1x⁠. So log⁡x\log x is the function to differentiate, and xx is the one to integrate. After one use of the formula, 1x\frac1x cancels a power of xx and the remaining integral is a plain power.

Given, to find, and the plan
Given
The function xlog⁡xx\log x (natural logarithm). It is defined only for x>0x > 0⁠, because log⁡x\log x is.
To find
∫xlog⁡x dx\int x\log x\,dx on x>0x > 0⁠.
Plan
(1) Name uu and dvdx\frac{dv}{dx} and explain why log⁡x\log x is uu⁠. (2) Find dudx\frac{du}{dx} and vv⁠. (3) Apply the formula and simplify. (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 first, but if the other function is logarithmic or inverse trigonometric, that one is first. Memory aid ILATE (Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential; not in the book): L comes before A.

3Derivative of log⁡x\log x

ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0 (standard formula (xii) read as a derivative). Basics: logarithms and 1/x

4Power 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. Name uu and dvdx\frac{dv}{dx}

    u=log⁡x(first),dvdx=x(second).\begin{aligned} u &= \log x \quad (\text{first}), \\ \frac{dv}{dx} &= x \quad (\text{second}). \end{aligned}
    ILATE: log⁡x\log x is Logarithmic, xx is Algebraic, and L comes before A. The reason: if we tried u=xu = x⁠, we would need v=∫log⁡x dxv = \int\log x\,dx first, which itself needs integration by parts (Example 18), and the new integral would be no simpler. With u=log⁡xu = \log x⁠, differentiating gives the simple 1x\frac1x⁠.
    Remark (iii) after Example 17, Section 7.6. Lesson: integration by parts
  2. Find dudx\frac{du}{dx} and vv

    dudx=1x,v=∫x dx=x22.\frac{du}{dx} = \frac1x, \qquad v = \int x\,dx = \frac{x^2}{2}.
    The derivative of log⁡x\log x is 1x\frac1x (valid since x>0x > 0⁠); vv comes from the power rule with n=1n = 1⁠. No constant is added to vv (Remark (ii) after Example 17).
    Standard formulae (xii) and (i), Section 7.2. Basics: logarithms and 1/x
  3. Apply the formula

    ∫xlog⁡x dx=uv−∫v dudx dx=x22log⁡x−∫x22⋅1x dx=x22log⁡x−12∫x dx.\begin{aligned} \int x\log x\,dx &= uv - \int v\,\frac{du}{dx}\,dx \\ &= \frac{x^2}{2}\log x - \int\frac{x^2}{2}\cdot\frac1x\,dx \\ &= \frac{x^2}{2}\log x - \frac12\int x\,dx. \end{aligned}
    x22⋅1x=x2\frac{x^2}{2}\cdot\frac1x = \frac x2 because x≠0x \ne 0⁠: the 1x\frac1x from differentiating the logarithm cancels one power of xx⁠. The logarithm has disappeared from the integral that is left.
    Section 7.6, equation (1); constant multiple rule (Section 7.2.1). Lesson: integration by parts
  4. Finish the remaining integral

    ∫xlog⁡x dx=x22log⁡x−12⋅x22+C=x22log⁡x−x24+C.\begin{aligned} \int x\log x\,dx &= \frac{x^2}{2}\log x - \frac12\cdot\frac{x^2}{2} + C \\ &= \frac{x^2}{2}\log x - \frac{x^2}{4} + C. \end{aligned}
    ∫x dx=x22\int x\,dx = \frac{x^2}{2} by the power rule, multiplied by 12\frac12⁠. One constant CC at the end.
    Standard formula (i), Section 7.2. Basics: powers of x
  5. Check: differentiate the answer

    Product rule on the first term:

    ddx(x22log⁡x−x24)=xlog⁡x+x22⋅1x−2x4=xlog⁡x+x2−x2=xlog⁡x.\begin{aligned} &\frac{d}{dx}\Big(\frac{x^2}{2}\log x - \frac{x^2}{4}\Big) \\ &= x\log x + \frac{x^2}{2}\cdot\frac1x - \frac{2x}{4} \\ &= x\log x + \frac x2 - \frac x2 = x\log x. \end{aligned}
    The derivative is exactly the integrand at every x>0x > 0⁠.
    Product rule; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠. Basics: integration undoes differentiation
Result ∫xlog⁡x dx=x22log⁡x−x24+C,\int x\log x\,dx = \frac{x^2}{2}\log x - \frac{x^2}{4} + C,

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

Check it with numbers

With F(x)=x22log⁡x−x24F(x) = \frac{x^2}{2}\log x - \frac{x^2}{4}⁠, on [1,e][1, e]⁠, where log⁡1=0\log 1 = 0 and log⁡e=1\log e = 1⁠:

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

Numerical integration of xlog⁡xx\log x over [1,e][1, e] gives 2.0972640247…2.0972640247\ldots⁠, the same.

Common mistakes
  1. Taking u=xu = x⁠. Then v=∫log⁡x dxv = \int\log x\,dx is needed first (Example 18), and the new integral contains the original one again: a longer, roundabout route.
  2. Forgetting the domain. log⁡x\log x needs x>0x > 0⁠; the answer is valid only there.
  3. Last coefficient. 12∫x dx=x24\frac12\int x\,dx = \frac{x^2}{4}⁠, not x22\frac{x^2}{2}⁠.
What to take away
  1. A logarithm times a power of xx⁠: the logarithm is uu⁠, because its derivative 1x\frac1x is algebraic and cancels against the power.
  2. The same steps give, for n≠−1n \ne -1 and x>0x > 0⁠, ∫xnlog⁡x dx=xn+1n+1log⁡x−xn+1(n+1)2+C.\int x^n\log x\,dx = \frac{x^{n+1}}{n+1}\log x - \frac{x^{n+1}}{(n+1)^2} + C. This question is n=1n = 1⁠; Question 6 is n=2n = 2⁠.
  3. State the domain whenever a logarithm appears.

Every fact used, and where it comes from

FactUsed inSource
Integration by partsStep 3Section 7.6, equation (1) (Lesson: integration by parts)
Logarithm as the first function (ILATE)Step 1Remark (iii) after Example 17, Section 7.6; Example 18
No constant needed in vvStep 2Remark (ii) after Example 17, Section 7.6
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x for x>0x > 0Steps 2, 5Standard formula (xii), Section 7.2; Chapter 5
Power rule ∫xndx\int x^n dxSteps 2, 4Standard formula (i), Section 7.2
Constant multiple ruleStep 3Property (IV), Section 7.2.1
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 →