Why a Logarithm Appears
The power rule gives antiderivatives for many powers of \(x\), but it has an important exception. When the integrand is \(1/x=x^{-1}\), the usual power-rule calculation would require dividing by \(-1+1=0\). That division is not defined. A different function is needed, and the natural logarithm provides it.
This result is more than a special formula to memorize. It follows from the derivative of the natural logarithm, and it extends directly to expressions with a linear denominator. The central habit is to check the derivative of the proposed answer: that check confirms both the formula and its constant factor.
The Antiderivative of One Over \(x\)
The natural logarithm \(\ln x\) is defined for positive \(x\), and its derivative is \(1/x\). Thus, when \(x>0\), differentiating \(\ln x\) gives the desired integrand. But \(1/x\) is also defined for negative \(x\), so a formula for its antiderivative should work on negative intervals too.
For \(x\ne 0\), the expression \(\ln|x|\) is defined. Its derivative is \(1/x\) on both sides of zero. For \(x>0\), \(|x|=x\), so \(\ln|x|=\ln x\). For \(x<0\), \(|x|=-x\), so the chain rule gives \(\frac{d}{dx}\ln(-x)=\frac{1}{-x}(-1)=1/x\).
\(\displaystyle \int \frac{1}{x}\,dx=\ln|x|+C.\)
Here \(C\) is an arbitrary constant. The formula applies separately on intervals to the left or right of zero; it does not define an antiderivative across zero, where the integrand is undefined.
The absolute value is essential to a formula that covers both positive and negative inputs. On a domain restricted to \(x>0\), \(\ln x+C\) is equivalent. On a domain restricted to \(x<0\), \(\ln(-x)+C\) is also equivalent. The compact expression \(\ln|x|+C\) covers either kind of interval without choosing a sign in advance.
Why the Logarithmic Formula Works
The formula can be justified completely by differentiation. An antiderivative of a function \(f\) on an interval is a function \(F\) whose derivative equals \(f\) at every point in that interval. Therefore, to establish the logarithmic formula, we differentiate the proposed function on each part of its domain.
If \(x>0\), then \(|x|=x\), and \(\frac{d}{dx}\ln|x|=\frac{d}{dx}\ln x=1/x\).
If \(x<0\), then \(|x|=-x\), and \(\frac{d}{dx}\ln|x|=\frac{d}{dx}\ln(-x)=\frac{1}{-x}(-1)=1/x\).
Since the derivative of \(C\) is zero, \(\frac{d}{dx}\bigl(\ln|x|+C\bigr)=1/x\) wherever \(x\ne 0\).
This proves the formula on any interval that lies entirely on one side of zero. The restriction matters: \(1/x\) is undefined at zero, so there cannot be an antiderivative of this integrand on an interval that includes zero.
Reciprocal Linear Expressions
A linear expression \(ax+b\) changes at the constant rate \(a\). When \(a\ne 0\), the denominator \(ax+b\) is zero at \(x=-b/a\), so the reciprocal is defined only away from that value. The antiderivative formula applies on any interval that does not include this point.
To find the formula, differentiate \(\ln|ax+b|\). The chain rule gives a factor of \(a\):
The derivative is \(a\) times the integrand \(1/(ax+b)\). Multiplying the logarithm by \(1/a\) cancels that factor. This explains why the slope of the linear expression appears in the denominator of the antiderivative.
\(\displaystyle \int \frac{1}{ax+b}\,dx=\frac{1}{a}\ln|ax+b|+C.\)
More generally, for a constant \(k\), \(\displaystyle \int \frac{k}{ax+b}\,dx=\frac{k}{a}\ln|ax+b|+C\). The second formula follows by multiplying the first integrand by \(k\).
Worked Examples
Worked Example: Integrate One Over a Negative Input
Find an antiderivative of \(\displaystyle \frac{1}{x}\) on the interval \(x<0\).
The integrand is defined throughout this interval, and \(|x|=-x\) there. The logarithmic formula gives
Since \(x<0\), the same expression can be written \(\ln(-x)+C\). Check by differentiating:
The derivative equals the original integrand at every \(x<0\), so the antiderivative is verified.
Worked Example: Integrate a Reciprocal Linear Expression
Find \(\displaystyle \int \frac{6}{3x-2}\,dx\).
Here the numerator is \(6\), and the denominator has slope \(3\). The coefficient in front of the logarithm is \(6/3=2\). Thus
The denominator is zero when \(3x-2=0\), so \(x=2/3\) is excluded. The formula applies on any interval that does not contain \(2/3\). Check by differentiating the proposed answer:
This is the original integrand, as required.
Worked Example: Account for a Negative Slope
Find \(\displaystyle \int \frac{5}{4-2x}\,dx\).
Write the denominator as \(ax+b\), so \(a=-2\) and \(b=4\). The numerator divided by this slope is \(5/(-2)=-5/2\). Therefore
The denominator vanishes at \(4-2x=0\), or \(x=2\), so the expression is considered on an interval that does not contain \(2\). Differentiate to check both the sign and the factor:
The two negative factors cancel, giving the original integrand. This confirms that the coefficient must include the negative slope.
Conditions and Limits of the Formula
Before applying a logarithmic antiderivative, check that the denominator really has the required form and that it is nonzero on the interval under consideration. For \(1/(ax+b)\), the stated formula requires \(a\ne 0\). If \(a=0\), the denominator is the constant \(b\); when \(b\ne 0\), the integrand is constant \(1/b\), not a reciprocal linear expression with a nonzero slope.
The logarithmic formula also does not say that every fraction has a logarithmic antiderivative of this form. It applies when the numerator is constant and the denominator is linear, or when the numerator is a constant multiple of the derivative of the denominator. More complicated rational expressions may require other methods. In this lesson, the useful recognition pattern is specifically a constant over a nonconstant linear expression.
As with other indefinite integrals, the answer represents a family of antiderivatives. On a given interval, adding any constant \(C\) does not change the derivative. If the domain has separate pieces on either side of the point where the denominator is zero, the constants on those separate intervals need not be the same: the derivative condition cannot connect values across a point outside the domain.
Common Mistakes
A frequent error is to omit the factor coming from the slope of the denominator. For example, the following calculation is wrong:
Differentiate the proposed answer to test it:
which is three times the requested integrand. The correction is to divide by the slope \(3\):
Another common error is writing \(\ln x\) for an integrand \(1/x\) without restricting to \(x>0\). On a negative interval, \(\ln x\) is not defined as a real-valued function. Writing \(\ln|x|\) correctly covers all \(x\ne 0\), while still respecting the fact that the integrand itself is undefined at zero.
Why This Antiderivative Matters
The logarithmic antiderivative completes an important exception in the basic power-rule patterns. Powers other than \(x^{-1}\) can be handled by the power rule for antiderivatives, while \(1/x\) leads to \(\ln|x|\). Recognizing this exception prevents an invalid division by zero and gives a reliable way to handle reciprocal linear expressions.
It also builds a useful connection between differentiation and integration. The factor \(1/a\) in the answer is not an arbitrary adjustment: it compensates for the factor \(a\) produced when the logarithm is differentiated by the chain rule. Whenever a logarithm appears in an antiderivative, verifying it by differentiation is a direct way to catch sign and scale errors.
Check Your Understanding
For each question, state any domain restriction and use differentiation to check your proposed antiderivative.
- Find an antiderivative of \(1/x\) on an interval where \(x>0\).
- Find an antiderivative of \(1/(5x+2)\).
- Find an antiderivative of \(8/(2x-7)\).
- Why is an interval containing \(x=0\) not a valid interval for an antiderivative of \(1/x\)?
- What is wrong with using \(\ln|2x+1|+C\) as an antiderivative of \(1/(2x+1)\)?