Why Integrate the Natural Logarithm by Parts?
The derivative of the natural logarithm is simple: for \(x>0\), \(\frac{d}{dx}\ln x=\frac{1}{x}\). But \(\ln x\) does not appear in the usual list of basic antiderivatives. To integrate it, we can use integration by parts by viewing the logarithm as a product with \(1\):
This choice is useful because differentiating \(\ln x\) gives the simpler expression \(1/x\), while \(1\) has the easy antiderivative \(x\). The resulting integral is then \(\int x(1/x)\,dx=\int 1\,dx\), which is straightforward.
Throughout this tutorial, \(x>0\). This condition is essential: the real-valued natural logarithm \(\ln x\) is defined only for positive \(x\). We seek an antiderivative on the interval \((0,\infty)\).
The Integration-by-Parts Setup
For the product \((\ln x)\cdot 1\), take \(u=\ln x\) and \(g(x)=1\). Then \(u'=1/x\), and an antiderivative of \(g\) is \(v=x\). Substitution into the formula gives
The remaining integral is \(x\), up to an additive constant. Therefore a candidate antiderivative is \(x\ln x-x\). Since indefinite integrals represent families of antiderivatives, we include an arbitrary constant \(C\).
Worked Example: Integrating \(\ln x\)
Worked Example: Integrating \(\ln x\)
Find \(\int \ln x\,dx\) for \(x>0\), using integration by parts and checking the answer by differentiation.
First write the integrand as a product:
Choose \(u=\ln x\) and \(g(x)=1\). Their required derivatives and antiderivative are
Apply integration by parts:
To check, differentiate the proposed primitive. The product rule gives
The derivative matches the integrand for every \(x>0\), so the result is verified.
Why This Calculation Works
The core justification can be seen directly from the product rule. On \(x>0\), both \(x\) and \(\ln x\) are differentiable, and
Rearranging this identity yields \(\ln x=\frac{d}{dx}(x\ln x)-1\). Integrating both sides gives
This is the same reasoning expressed by integration by parts: the method moves a derivative from one factor to another using the product rule. Here, the product \(x\ln x\) differentiates to the desired logarithm plus a simple extra term, \(1\), which can be subtracted away.
The product-rule argument also makes clear why the domain condition matters. The derivative \((\ln x)'=1/x\) and the real-valued function \(\ln x\) used in the calculation are defined on \(x>0\). Thus the formula is asserted on that interval, not for all real \(x\).
Worked Example: A Constant Multiple
Worked Example: Integrating \(-2\ln x\)
Find \(\int -2\ln x\,dx\) for \(x>0\), and verify the result.
The constant factor can be kept outside the integral. Using the antiderivative just established,
Differentiate the proposed antiderivative:
The derivative is the original integrand. The constant \(C\) remains arbitrary because its derivative is zero.
The Constant of Integration and a Specified Value
An indefinite integral gives a family of functions rather than one uniquely determined function. If \(F\) is an antiderivative of \(\ln x\), then \(F+C\) is also an antiderivative for every constant \(C\), since \(\frac{d}{dx}C=0\). On the interval \((0,\infty)\), every antiderivative has the form \(x\ln x-x+C\).
Sometimes a problem gives an additional condition that determines \(C\). That condition selects one function from the family, but it does not change the integration-by-parts calculation.
Worked Example: Choosing the Constant at \(x=1\)
Find an antiderivative \(F\) of \(\ln x\) such that \(F(1)=0\).
Start with the general antiderivative:
Use \(\ln 1=0\) and substitute \(x=1\) into the condition:
Thus \(C=1\), and the requested function is
Check both requirements. First, \(F(1)=1\cdot 0-1+1=0\). Second,
So \(F\) has the correct derivative and satisfies the specified value.
Common Mistakes and How to Correct Them
A frequent mistake is to treat \(\ln x\) as if its antiderivative were also \(\ln x\). That would give an incorrect answer because differentiating \(\ln x\) produces \(1/x\), not \(\ln x\). For example, at \(x=e\), the derivative of \(\ln x\) is \(1/e\), whereas the integrand \(\ln x\) has value \(1\). These values are not equal.
Another error is choosing factors that make the calculation harder or circular. For instance, if one sets \(u=1\) and \(g(x)=\ln x\), then one must first find an antiderivative \(v\) of \(\ln x\). But that is exactly the integral being sought; this choice does not advance the calculation. Also, \(v=x\) would not be valid for that choice, because \(v'=1\), not \(\ln x\).
The effective choice is \(u=\ln x\) and \(g(x)=1\). It uses the simpler derivative \(u'=1/x\) and the known antiderivative \(v=x\), making the remaining product \(vu'=x(1/x)=1\). A useful check when choosing factors is to confirm both that \(v'=g\) and that the new integral is simpler than the original one.
Using the Formula Reliably
For this integral, the method can be organized into a short sequence. Each step has a specific purpose:
Use \(\ln x=(\ln x)\cdot 1\), with \(x>0\).
Set \(u=\ln x\), so \(u'=1/x\), and take \(g(x)=1\), whose antiderivative is \(v=x\).
Compute \(uv-\int vu'\,dx=x\ln x-\int 1\,dx\).
Write \(x\ln x-x+C\), then differentiate to recover \(\ln x\).
The verification is not a formality. It catches sign errors and missing terms immediately. In this calculation, the derivative of \(x\ln x\) contributes an extra \(1\); the subtraction of \(x\) is what cancels it. Omitting that term would leave a derivative of \(\ln x+1\), not the required \(\ln x\).
Summary
To integrate the natural logarithm, write it as \((\ln x)\cdot 1\), differentiate the logarithm, and integrate the factor \(1\). Integration by parts then reduces the problem to the integral of \(1\). For \(x>0\), the result is
The product rule explains the same result: \((x\ln x)'=\ln x+1\), so subtracting the derivative of \(x\) leaves \(\ln x\). Always retain the domain condition \(x>0\), include the arbitrary constant in an indefinite integral, and check the final expression by differentiation.
Check Your Understanding
Try answering these questions using the definitions, calculation, and verification above.
- Why is it useful to write \(\ln x\) as \((\ln x)\cdot 1\) before applying integration by parts?
- For the choice \(u=\ln x\) and \(g(x)=1\), what are \(u'\) and an antiderivative \(v\) of \(g\)?
- Differentiate \(x\ln x-x+C\) and show that it gives the original integrand.
- Why is \(\ln x+C\) not an antiderivative of \(\ln x\)?
- If an antiderivative is required to satisfy \(F(1)=0\), what value of \(C\) should be used?