← MATH 162 MathScape 0 MATH162

Integrals Yielding Natural Logarithm

4 min read

Jump to a section
Reference: Stewart §6.4

Filling the Gap in the Power Rule

Remember the power rule for integration?

$$\int x^n \, dx = \frac{x^{n+1}}{n+1} + C \quad \text{(when } n \neq -1\text{)}$$

What happens when $n = -1$? The formula would give $\frac{x^0}{0}$, which is undefined.

This is where the natural logarithm saves us:

$$\boxed{\int \frac{1}{x}\,dx = \ln\vert x\vert + C}$$

The integral of $\frac{1}{x}$ is not a power function; it is a logarithm. This formula fills the one gap in the power rule and connects differentiation of logs back to integration.


Prerequisite Map

Before You Start

Quick check: Do you know the derivative of ln?

Test: What is $\frac{d}{dx}[\ln(x^2 + 1)]$?

Answer: $\frac{2x}{x^2 + 1}$

If this is unfamiliar, review Derivative of Natural Log first.


Quick Reference

Integral Result Valid Domain
$\displaystyle\int \frac{1}{x}\,dx$ $\ln\|x\| + C$ $x \neq 0$
$\displaystyle\int \frac{f'(x)}{f(x)}\,dx$ $\ln\|f(x)\| + C$ $f(x) \neq 0$
$\displaystyle\int \frac{1}{ax + b}\,dx$ $\frac{1}{a}\ln\|ax + b\| + C$ $ax + b \neq 0$

Verification: You can always check by differentiating your answer.


Key Concepts

The Fundamental Formula

$$\boxed{\int \frac{1}{x}\,dx = \ln\vert x\vert + C}$$

Why the absolute value? The function $\frac{1}{x}$ is defined for all $x \neq 0$, including negative $x$. But $\ln x$ only accepts positive inputs. The absolute value extends our antiderivative to negative values:

The Pattern Recognition Formula

This is the most important formula for recognizing ln integrals:

$$\boxed{\int \frac{f'(x)}{f(x)}\,dx = \ln\vert f(x)\vert + C}$$

In words: If the numerator is the derivative of the denominator, the integral is ln of the denominator.

How to spot it:

  1. Look at the denominator. Call it $f(x)$.
  2. Ask: Is the numerator $f'(x)$ (or a constant multiple of it)?
  3. If yes, the integral involves $\ln\vert f(x)\vert $.

Linear Denominators

For $\int \frac{1}{ax + b}\,dx$:

Let $u = ax + b$, so $du = a\,dx$, meaning $dx = \frac{1}{a}du$.

$$\int \frac{1}{ax + b}\,dx = \frac{1}{a}\int \frac{1}{u}\,du = \frac{1}{a}\ln\vert u\vert + C = \frac{1}{a}\ln\vert ax + b\vert + C$$

Shortcut formula: $$\boxed{\int \frac{1}{ax + b}\,dx = \frac{1}{a}\ln\vert ax + b\vert + C}$$


Practice Problems

Level 1 Basic Formula

Evaluate $\displaystyle\int_1^e \frac{1}{x}\,dx$.

Thought Process

This is a direct application of the fundamental formula.

Since the limits are positive ($1$ to $e$), we can drop the absolute value.

Show Answer

$$\int_1^e \frac{1}{x}\,dx = \ln\vert x\vert \Big\vert _1^e = \ln e - \ln 1 = 1 - 0 = 1$$

Geometric meaning: The area under $y = \frac{1}{x}$ from $x = 1$ to $x = e$ is exactly 1. This is actually how $e$ is defined!

Level 2 Linear Denominator

Evaluate $\displaystyle\int \frac{1}{3x + 5}\,dx$.

Thought Process

This is $\frac{1}{ax + b}$ with $a = 3$ and $b = 5$.

Use the shortcut: $\frac{1}{a}\ln\vert ax + b\vert + C$.

Alternatively, substitute $u = 3x + 5$.

Show Answer

$$\int \frac{1}{3x + 5}\,dx = \frac{1}{3}\ln\vert 3x + 5\vert + C$$

Check: $\frac{d}{dx}\left[\frac{1}{3}\ln\vert 3x + 5\vert \right] = \frac{1}{3} \cdot \frac{3}{3x + 5} = \frac{1}{3x + 5}$ ✓

Level 2 Recognizing the Pattern

Evaluate $\displaystyle\int \frac{2x}{x^2 + 4}\,dx$.

Thought Process

Look at the denominator: $f(x) = x^2 + 4$.

Its derivative: $f'(x) = 2x$.

The numerator IS exactly $f'(x)$! This fits the pattern $\int \frac{f'(x)}{f(x)}dx$.

Show Answer

Since the numerator $2x$ is exactly the derivative of the denominator $x^2 + 4$:

$$\int \frac{2x}{x^2 + 4}\,dx = \ln\vert x^2 + 4\vert + C = \ln(x^2 + 4) + C$$

Note: We can drop the absolute value since $x^2 + 4 > 0$ for all $x$.

Level 3 Adjusting the Numerator

Evaluate $\displaystyle\int \frac{x}{x^2 + 1}\,dx$.

Thought Process

Denominator: $f(x) = x^2 + 1$, so $f'(x) = 2x$.

Numerator: $x$, which is $\frac{1}{2}$ of $f'(x)$.

We need to adjust: $\int \frac{x}{x^2+1}dx = \frac{1}{2}\int \frac{2x}{x^2+1}dx$.

Show Answer

Rewrite to match the pattern: $$\int \frac{x}{x^2 + 1}\,dx = \frac{1}{2}\int \frac{2x}{x^2 + 1}\,dx$$

Now the numerator is the derivative of the denominator: $$= \frac{1}{2}\ln\vert x^2 + 1\vert + C = \frac{1}{2}\ln(x^2 + 1) + C$$

Level 3 Trigonometric Function

Evaluate $\displaystyle\int \tan x\,dx$.

Thought Process

Rewrite $\tan x = \frac{\sin x}{\cos x}$.

Denominator: $f(x) = \cos x$, so $f'(x) = -\sin x$.

Numerator: $\sin x = -f'(x)$.

So $\int \tan x\,dx = -\int \frac{-\sin x}{\cos x}dx = -\int \frac{f'(x)}{f(x)}dx$.

Show Answer

Rewrite as a fraction: $$\int \tan x\,dx = \int \frac{\sin x}{\cos x}\,dx$$

Let $u = \cos x$, so $du = -\sin x\,dx$: $$= -\int \frac{1}{u}\,du = -\ln\vert u\vert + C = -\ln\vert \cos x\vert + C$$

This can also be written as $\ln\vert \sec x\vert + C$ (since $-\ln\vert \cos x\vert = \ln\vert \cos x\vert ^{-1} = \ln\vert \sec x\vert $).

Level 4 Definite Integral with Substitution

Evaluate $\displaystyle\int_1^e \frac{\ln x}{x}\,dx$.

Thought Process

This doesn’t fit the $\frac{f'}{f}$ pattern directly.

Try substitution: let $u = \ln x$, so $du = \frac{1}{x}dx$.

When $x = 1$: $u = \ln 1 = 0$. When $x = e$: $u = \ln e = 1$.

The integral becomes $\int_0^1 u\,du$.

Show Answer

Let $u = \ln x$, so $du = \frac{1}{x}dx$.

Changing limits: $x = 1 \Rightarrow u = 0$; $x = e \Rightarrow u = 1$.

$$\int_1^e \frac{\ln x}{x}\,dx = \int_0^1 u\,du = \frac{u^2}{2}\Big\vert _0^1 = \frac{1}{2} - 0 = \frac{1}{2}$$

Level 4 Area Under the Hyperbola

Find the area of the region under $y = \frac{1}{x}$ from $x = 1$ to $x = 2$.

Thought Process

Area under a curve from $a$ to $b$ is $\int_a^b f(x)\,dx$.

Here $f(x) = \frac{1}{x}$, $a = 1$, $b = 2$.

Since $x > 0$ on this interval, we can drop the absolute value.

Show Answer

$$\text{Area} = \int_1^2 \frac{1}{x}\,dx = \ln\vert x\vert \Big\vert _1^2 = \ln 2 - \ln 1 = \ln 2 \approx 0.693$$

This is the area of the region bounded by $y = \frac{1}{x}$, the $x$-axis, and the vertical lines $x = 1$ and $x = 2$.

Level 5 Explain the Absolute Value

Why do we write $\int \frac{1}{x}dx = \ln\vert x\vert + C$ instead of $\ln x + C$?

Verify that $\frac{d}{dx}(\ln\vert x\vert ) = \frac{1}{x}$ for both positive and negative $x$.

Thought Process

Consider two cases: $x > 0$ and $x < 0$.

For $x > 0$: $\vert x\vert = x$, so $\ln\vert x\vert = \ln x$.

For $x < 0$: $\vert x\vert = -x$ (which is positive), so $\ln\vert x\vert = \ln(-x)$.

Use the chain rule to differentiate $\ln(-x)$.

Show Answer

Case 1: $x > 0$

$\ln\vert x\vert = \ln x$

$\frac{d}{dx}(\ln x) = \frac{1}{x}$ ✓

Case 2: $x < 0$

$\ln\vert x\vert = \ln(-x)$ (note: $-x > 0$ when $x < 0$)

$\frac{d}{dx}[\ln(-x)] = \frac{1}{-x} \cdot (-1) = \frac{1}{x}$ ✓

Conclusion: The derivative is $\frac{1}{x}$ in both cases.

Why it matters: The function $\frac{1}{x}$ is defined for all $x \neq 0$, but $\ln x$ is only defined for $x > 0$. Using $\ln\vert x\vert $ extends the antiderivative to negative $x$ values.

Important caveat: The constant $C$ can be different on the intervals $(-\infty, 0)$ and $(0, \infty)$ since they’re disconnected. So more precisely: $$\int \frac{1}{x}dx = \begin{cases} \ln x + C_1 & \text{if } x > 0 \\ \ln(-x) + C_2 & \text{if } x < 0 \end{cases}$$


Pattern Recognition Guide

When you see an integral, ask these questions:

  1. Is the denominator linear? ($ax + b$)

    • Answer: $\frac{1}{a}\ln\vert ax + b\vert + C$
  2. Is the numerator the derivative of the denominator?

    • If yes: $\ln\vert (\text{denominator})\vert + C$
    • If almost (off by a constant): factor out the constant, then apply the rule
  3. Is it a trig function in disguise?

    • $\tan x = \frac{\sin x}{\cos x}$ → leads to $-\ln\vert \cos x\vert $ or $\ln\vert \sec x\vert $
    • $\cot x = \frac{\cos x}{\sin x}$ → leads to $\ln\vert \sin x\vert $

Common Mistakes

Mistake Why It’s Wrong Correct Approach
$\int \frac{1}{x}dx = \ln x + C$ Missing absolute value $\ln\|x\| + C$
$\int \frac{1}{2x}dx = \ln\|2x\| + C$ Forgot the coefficient adjustment $\frac{1}{2}\ln\|2x\| + C$ or equivalently $\frac{1}{2}\ln\|x\| + C$
$\int \frac{x}{x^2}dx = \ln\|x^2\| + C$ The numerator is not the derivative of denominator $\int \frac{1}{x}dx = \ln\|x\| + C$
Writing $\ln(x^2 + 4)$ without checking sign Could need absolute value Here $x^2 + 4 > 0$ always, so no absolute value needed

Common Misconceptions

Common misconception

$\int \frac{1}{x}\,dx = \ln x + C$, omitting the absolute value.

This is the concept-image-conflicts-definition error. The function $\frac{1}{x}$ is defined for all $x \neq 0$, including negative values. On the interval $(-\infty, 0)$, the correct antiderivative is $\ln(-x) + C$, since $\frac{d}{dx}[\ln(-x)] = \frac{-1}{-x} = \frac{1}{x}$. Writing $\ln\vert x\vert + C$ unifies both cases. Omitting the absolute value produces an antiderivative that is only valid for $x > 0$, yet $\frac{1}{x}$ is perfectly integrable on intervals that do not include zero.


Mastery Checklist


Mental Model

“Derivative on top, function on bottom = ln of the bottom”

When you see a fraction where:

Then the integral is $\ln\vert f(x)\vert + C$.

Visual check: Cover the numerator. Take its derivative mentally. Does it match (or nearly match) the numerator you see? If yes, use ln.


Connections

Looking back:

Looking ahead:

Real-world applications:



Last updated: 2026-01-23