Tutorials › Calculus I › Integrating The Natural Logarithm

Antiderivatives and Basic Integrals · Tutorial 1059 of 1495

Integrating The Natural Logarithm

Learn to derive and verify the antiderivative of the natural logarithm on positive inputs by recognizing a product rule in reverse.

Beginner 9 min read

What You'll Learn

  • Derive the antiderivative of the natural logarithm using the product rule in reverse
  • Explain why the input must be positive
  • Verify the formula by differentiating it
  • Use the formula in integrals with constant multiples and added constants
  • Recognize and correct common errors involving the missing subtraction term or domain

Why the Natural Logarithm Has a Less Obvious Antiderivative

For many basic functions, an antiderivative can be recognized by recalling a familiar differentiation rule. The natural logarithm presents a small puzzle: its derivative is \(1/x\), but the function \(\ln x\) itself is not a simple power of \(x\). The power rule for antiderivatives therefore does not directly give its antiderivative.

A useful approach is to look for a product whose derivative contains \(\ln x\). The expression \(x\ln x\) is a natural candidate: differentiating it uses the product rule, and one of the resulting terms is exactly \(\ln x\). The other term can then be accounted for.

Key result: For \(x>0\), an antiderivative of \(\ln x\) is \(x\ln x-x\). Therefore, on the interval \((0,\infty)\), $$ \int \ln x\,dx=x\ln x-x+C, $$ where \(C\) is an arbitrary constant.

Domain and Definition

The real natural logarithm \(\ln x\) is defined only when \(x>0\). Accordingly, the antiderivative formula in this tutorial applies on the positive real numbers. It does not describe a real-valued antiderivative on an interval containing zero or negative inputs.

Recall that an antiderivative of a function \(f\) on an interval is a differentiable function \(F\) such that \(F'(x)=f(x)\) at every point in that interval. Indefinite integral notation records the family of antiderivatives. In this case, we seek a function \(F\) satisfying \(F'(x)=\ln x\) for every \(x>0\).

The needed differentiation facts are the product rule and the derivative of the natural logarithm:

$$ (uv)'=u'v+uv', \qquad \frac{d}{dx}\ln x=\frac{1}{x}\quad (x>0). $$

Reverse the Product Rule

Start with the product \(x\ln x\). The product rule gives two terms. One is the desired logarithm, and the other is a constant:

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

Thus \(x\ln x\) differentiates to \(\ln x+1\), not just \(\ln x\). To remove the extra \(1\), subtract a function whose derivative is \(1\), namely \(x\). This suggests \(x\ln x-x\). The computation is not a guess that must be trusted: differentiation checks it exactly.

$$ \frac{d}{dx}(x\ln x-x) = \ln x+1-1 = \ln x \qquad (x>0). $$

This is the product rule used in reverse. In forward differentiation, a product produces a sum of terms. Here, we identify a product that produces the desired function along with an extra term, then cancel that extra term by subtracting its antiderivative.

Why the subtraction is necessary: The derivative of \(x\ln x\) is \(\ln x+1\). Since the target is only \(\ln x\), the derivative of the correction term must be \(1\). Subtracting \(x\) supplies exactly that correction.

Derivation and Verification of the Formula

The derivation can be written as a complete chain of reasoning. First, the product rule and \((\ln x)'=1/x\) establish that the derivative of \(x\ln x\) is \(\ln x+1\) for \(x>0\). Second, the derivative of \(x\) is \(1\). Subtracting these derivative results yields the derivative of the difference:

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

Every equality holds for \(x>0\), where \(\ln x\) is defined. Therefore \(x\ln x-x\) is an antiderivative of \(\ln x\) on \((0,\infty)\). The earlier result that any two antiderivatives of the same function on an interval differ by a constant then gives the full family: every antiderivative on this interval has the form \(x\ln x-x+C\).

The constant \(C\) appears because differentiating a constant gives zero. Adding any constant to a verified antiderivative does not change its derivative. Conversely, the difference-between-antiderivatives result ensures that this accounts for all antiderivatives on the interval, rather than only providing one example.

Worked Examples

Worked Example: Find an Antiderivative of \(\ln x\)

Find \(\int \ln x\,dx\) for \(x>0\), and verify the result.

The product-rule calculation gives the candidate \(x\ln x-x\). Include the arbitrary constant to represent the full family:

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

Now differentiate the proposed antiderivative. Applying the product rule to \(x\ln x\) gives

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

The derivative equals the integrand for every \(x>0\), so the formula is verified. The constant contributes zero to the derivative.

Worked Example: Integrate a Constant Multiple and a Constant

Find an antiderivative of \(4\ln x+3\) on \((0,\infty)\).

By linearity, integrate the two terms separately. The antiderivative of \(\ln x\) is \(x\ln x-x\), and an antiderivative of the constant \(3\) is \(3x\):

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

Check by differentiating the simplified expression:

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

The derivative matches the original integrand, so \(4x\ln x-x+C\) is the required family of antiderivatives for \(x>0\).

Worked Example: Check a Proposed Antiderivative

Determine whether \(G(x)=2x\ln x-2x+7\) is an antiderivative of \(2\ln x\) on \((0,\infty)\).

Differentiate each term. For the product, use the product rule:

$$ \begin{aligned} G'(x) &=2\frac{d}{dx}(x\ln x)-2\frac{d}{dx}(x)+\frac{d}{dx}(7)\\ &=2\left(\ln x+1\right)-2+0\\ &=2\ln x+2-2\\ &=2\ln x. \end{aligned} $$

Thus the derivative is the stated function for every positive \(x\). The constant \(7\) does not affect the derivative, so \(G\) is indeed an antiderivative of \(2\ln x\) on \((0,\infty)\).

As a numerical check at \(x=1\), \(\ln 1=0\), so \(G'(1)=2\ln 1=0\). The original integrand at \(x=1\) is also \(2\ln 1=0\), consistent with the general calculation.

A Common Mistake: Forgetting the Extra Term

A frequent error is to notice that \(x\ln x\) contains \(\ln x\) and conclude that it must be an antiderivative of \(\ln x\). That overlooks the second term generated by the product rule. The incorrect calculation would be:

$$ \text{Incorrect:}\qquad \frac{d}{dx}(x\ln x)=\ln x. $$

The correct calculation includes both product-rule terms:

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

Therefore, \(x\ln x\) alone is not an antiderivative of \(\ln x\). Subtracting \(x\) corrects the extra \(1\), because

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

A second error is to write this real-valued formula for \(x\leq 0\). The expression \(\ln x\) is not defined as a real number there, so the real antiderivative statement must retain the condition \(x>0\). The absolute value used in the earlier antiderivative of the reciprocal function addresses a different integrand; it does not make \(\ln x\) defined for negative \(x\).

How to Recognize the Method

When an integrand is \(\ln x\), the useful clue is that differentiating \(x\ln x\) creates \(\ln x\) as one of its terms. A reliable reasoning sequence is:

1
Choose a product to differentiate.
Use \(x\ln x\), since its product rule includes the desired factor \(\ln x\).
2
Compute every product-rule term.
The result is \(\ln x+1\), not merely \(\ln x\).
3
Cancel the extra derivative.
Subtract \(x\), whose derivative is \(1\), to obtain \(x\ln x-x\).
4
Verify and state the domain.
Differentiate the candidate to recover \(\ln x\), and specify \(x>0\).

The point of the method is not to memorize a formula without checking it. The product rule explains why the term \(x\ln x\) appears, and differentiation confirms why the correction \(-x\) is required. This makes the formula easier to reconstruct and less likely to be confused with the antiderivative of a different logarithmic expression.

Summary

On positive inputs, the product rule gives \(\frac{d}{dx}(x\ln x)=\ln x+1\). Removing the extra \(1\) by subtracting \(x\) yields an antiderivative of the natural logarithm. The full family on \((0,\infty)\) is

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

The essential checks are to include both terms from the product rule, retain the domain condition \(x>0\), and differentiate the proposed answer to confirm that it returns the integrand.

Check Your Understanding

Answer these questions by using the product rule and checking proposed antiderivatives by differentiation.

  1. What is the derivative of \(x\ln x\) for \(x>0\), and which term must be corrected to obtain \(\ln x\)?
  2. Why does subtracting \(x\) from \(x\ln x\) produce an antiderivative of \(\ln x\)?
  3. Find the family of antiderivatives of \(3\ln x-2\) on \((0,\infty)\), and verify your result by differentiation.
  4. Is \(x\ln x+C\) an antiderivative of \(\ln x\)? Explain by computing its derivative.
  5. Why must the real-valued formula be stated for \(x>0\)?

Test yourself: Calculus I 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