Tutorials › Calculus II › Integrating The Natural Logarithm

Integration by Parts I · Tutorial 33 of 998

Integrating The Natural Logarithm

Use integration by parts to find an antiderivative of the natural logarithm and verify it by differentiation.

Beginner 9 min read

What You'll Learn

  • Explain why \(\ln x\) can be written as \((\ln x)\cdot 1\) for integration by parts
  • Choose the logarithm and \(1\,dx\) as the factors in the method
  • Derive the antiderivative \(x\ln x-x+C\)
  • Check the result by differentiating it on \(x>0\)
  • Identify common errors involving logarithm derivatives and integration-by-parts choices

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\):

$$ \ln x=(\ln x)\cdot 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

Formula: If \(u\) is differentiable and \(v\) is an antiderivative of a function \(g\) on an interval, then $$ \int u(x)g(x)\,dx=u(x)v(x)-\int v(x)u'(x)\,dx. $$ The formula follows from the product rule. It applies here because \(\ln x\) is differentiable and \(1\) has antiderivative \(x\) throughout \(x>0\).

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

$$ \int \ln x\,dx =x\ln x-\int x\cdot\frac{1}{x}\,dx =x\ln x-\int 1\,dx. $$

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\).

Result: For \(x>0\), $$ \int \ln x\,dx=x\ln x-x+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:

$$ \ln x=(\ln x)\cdot 1. $$

Choose \(u=\ln x\) and \(g(x)=1\). Their required derivatives and antiderivative are

$$ u'=\frac{1}{x}, \qquad v=x. $$

Apply integration by parts:

$$ \begin{aligned} \int \ln x\,dx &=uv-\int vu'\,dx\\ &=x\ln x-\int x\cdot\frac{1}{x}\,dx\\ &=x\ln x-\int 1\,dx\\ &=x\ln x-x+C. \end{aligned} $$

To check, differentiate the proposed primitive. The product rule gives

$$ \frac{d}{dx}(x\ln x-x+C) =\ln x+x\cdot\frac{1}{x}-1 =\ln x+1-1 =\ln x. $$

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

$$ \frac{d}{dx}(x\ln x) =1\cdot\ln x+x\cdot\frac{1}{x} =\ln x+1. $$

Rearranging this identity yields \(\ln x=\frac{d}{dx}(x\ln x)-1\). Integrating both sides gives

$$ \int \ln x\,dx=x\ln x-\int 1\,dx=x\ln x-x+C. $$

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,

$$ \begin{aligned} \int -2\ln x\,dx &=-2\int \ln x\,dx\\ &=-2(x\ln x-x)+C\\ &=-2x\ln x+2x+C. \end{aligned} $$

Differentiate the proposed antiderivative:

$$ \begin{aligned} \frac{d}{dx}(-2x\ln x+2x+C) &=-2(\ln x+1)+2\\ &=-2\ln x-2+2\\ &=-2\ln x. \end{aligned} $$

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:

$$ F(x)=x\ln x-x+C. $$

Use \(\ln 1=0\) and substitute \(x=1\) into the condition:

$$ \begin{aligned} 0=F(1) &=1\cdot\ln 1-1+C\\ &=0-1+C\\ &=C-1. \end{aligned} $$

Thus \(C=1\), and the requested function is

$$ F(x)=x\ln x-x+1. $$

Check both requirements. First, \(F(1)=1\cdot 0-1+1=0\). Second,

$$ F'(x)=\ln x+x\cdot\frac{1}{x}-1=\ln x. $$

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.

Correction: The antiderivative is \(x\ln x-x+C\), not \(\ln x+C\). Verify any proposed antiderivative by differentiating it and checking that the result equals the integrand.

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:

1
Write the product.
Use \(\ln x=(\ln x)\cdot 1\), with \(x>0\).
2
Choose the factors.
Set \(u=\ln x\), so \(u'=1/x\), and take \(g(x)=1\), whose antiderivative is \(v=x\).
3
Apply integration by parts.
Compute \(uv-\int vu'\,dx=x\ln x-\int 1\,dx\).
4
Include the constant and verify.
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

$$ \int \ln x\,dx=x\ln x-x+C. $$

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.

  1. Why is it useful to write \(\ln x\) as \((\ln x)\cdot 1\) before applying integration by parts?
  2. For the choice \(u=\ln x\) and \(g(x)=1\), what are \(u'\) and an antiderivative \(v\) of \(g\)?
  3. Differentiate \(x\ln x-x+C\) and show that it gives the original integrand.
  4. Why is \(\ln x+C\) not an antiderivative of \(\ln x\)?
  5. If an antiderivative is required to satisfy \(F(1)=0\), what value of \(C\) should be used?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon