On this page
∫log x dx looks unfair: there is one function, and integration by parts seems to need two. The trick is to make up the second one: write log x as log x × 1. Here log x means the natural logarithm, ln x. Then the same idea extends to (log x)² and x log x, two related integrals worth practising for Class 12 and JEE Main.
What is the integration by parts formula?
The rule is ∫u dv = uv − ∫v du, as stated in OpenStax Calculus Volume 2, section 3.1.
You differentiate u and integrate dv. So a good u gets simpler when differentiated, and a good dv is something you can integrate.
Which function should be u when you integrate log x?
OpenStax teaches the LIATE order (logarithmic, inverse trigonometric, algebraic, trigonometric, exponential) and says the type of function that appears first in the list "should be our first choice of u" (OpenStax). Notes for the NCERT Class 12 integrals chapter teach the same idea as ILATE, with inverse functions first (Careers360 NCERT notes). Either way, log comes before algebraic, so log x is u.
The other choice fails for a simple reason. Paul's Online Notes points out that taking dv = ln x dx means v = ∫ln x dx, so "we would need to know the answer ahead of time". You can differentiate log x easily (it becomes 1/x), but you cannot integrate it yet.
How do you integrate log x by parts, step by step?
Rewrite: ∫log x dx = ∫log x · 1 dx.
Choose u = log x and dv = dx.
Find du = (1/x) dx and v = x.
Substitute: ∫log x dx = x log x − ∫x · (1/x) dx.
Simplify: x · (1/x) = 1, so the leftover integral is ∫dx = x.
Answer: ∫log x dx = x log x − x + C.
This matches Example 6 in Paul's Online Notes and the worked solution in the Careers360 NCERT notes. In step 5, the 1/x from differentiating log x cancelled the x from integrating 1. That cancellation is why the trick works.
For more practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can see exactly where your u and dv went wrong.
How do you integrate (log x)² by parts?
Use the same move: write (log x)² × 1. Take u = (log x)² and dv = dx.
By the chain rule, du = 2 log x · (1/x) dx, and v = x.
Substitute: ∫(log x)² dx = x(log x)² − ∫x · 2 log x · (1/x) dx.
The x cancels again: = x(log x)² − 2∫log x dx.
Reuse the first result: = x(log x)² − 2(x log x − x) + C.
Answer: ∫(log x)² dx = x(log x)² − 2x log x + 2x + C.
Check: differentiating gives (log x)² + 2 log x − 2 log x − 2 + 2, which is (log x)².
Each round of parts lowers the power of log x by one: ∫(log x)ⁿ dx = x(log x)ⁿ − n∫(log x)ⁿ⁻¹ dx. So (log x)³ takes three rounds.
How do you integrate x log x?
Now there really are two functions, but the order still puts log first. Take u = log x and dv = x dx.
du = (1/x) dx and v = x²/2.
Substitute: ∫x log x dx = (x²/2) log x − ∫(x²/2) · (1/x) dx.
Simplify: the leftover is ∫(x/2) dx = x²/4.
Answer: ∫x log x dx = (x²/2) log x − x²/4 + C.
Check: differentiating gives x log x + x/2 − x/2, which is x log x.
The common slip here is taking u = x because "the polynomial goes in u" worked on ∫x eˣ dx. Paul's Online Notes warns against getting "too locked into perceived patterns" (source). With u = x you would need ∫log x dx just to find v, and the new integral contains x log x again: slower and easier to get wrong.
If the chain rule step felt shaky, the Fermi Concept Library gives each mathematics concept its own lesson, so you can revisit differentiation first.
A quick checklist before you write the answer
A log in the integrand? Make it u.
Only one function? Multiply by 1 and let dv = dx.
Can't write down v? Swap your choice.
Same shape with a lower power after one round? Repeat.
Differentiate your answer to check it.
Try it now on ∫x² log x dx without looking: take u = log x, and you should get (x³/3) log x − x³/9 + C.



