Tutorials › Calculus I › Absolute Values In Logarithmic Antiderivatives

Antiderivatives and Basic Integrals · Tutorial 1058 of 1495

Absolute Values In Logarithmic Antiderivatives

See why absolute values make the logarithmic antiderivative valid on both sides of zero, and why zero must remain excluded.

Beginner 9 min read

What You'll Learn

  • Explain why the natural logarithm of x alone does not cover negative inputs.
  • Derive the derivative of the natural logarithm of the absolute value of x on both sides of zero.
  • State the domain on which this antiderivative formula applies.
  • Verify logarithmic antiderivatives by differentiating them.
  • Distinguish the constants of integration on the two intervals separated by zero.

Why the Absolute Value Appears

The reciprocal function \(1/x\) is defined for every real number except zero. Its antiderivative must therefore account for both positive and negative inputs. The familiar logarithm \(\ln x\), however, is a real-valued function only when \(x>0\). Writing \(\ln x\) alone cannot give a real antiderivative of \(1/x\) on a negative interval.

The absolute value resolves this mismatch. For \(x>0\), \(|x|=x\); for \(x<0\), \(|x|=-x\), which is positive. Thus \(\ln|x|\) is defined for every \(x\ne0\). The key fact is that its derivative equals \(1/x\) on both sides of zero, even though its formula inside the logarithm behaves differently on each side.

Key formula: For every \(x\ne0\), the derivative of \(\ln|x|\) is \(1/x\). Consequently, on any interval that does not contain zero, an antiderivative of \(1/x\) is \(\ln|x|+C\).

Deriving the Formula on Each Interval

Zero separates the real domain of \(1/x\) into two intervals: \((-\infty,0)\) and \((0,\infty)\). To justify the formula, check the derivative separately on each interval. This is important because the absolute value has different expressions on the two sides.

1
For positive inputs.
If \(x>0\), then \(|x|=x\), so \(\ln|x|=\ln x\). The derivative rule for the natural logarithm gives \(\frac{d}{dx}\ln|x|=\frac{d}{dx}\ln x=\frac{1}{x}\).
2
For negative inputs.
If \(x<0\), then \(|x|=-x\), so \(\ln|x|=\ln(-x)\). By the chain rule, \(\frac{d}{dx}\ln(-x)=\frac{1}{-x}\cdot(-1)=\frac{1}{x}\).

Both calculations are valid on their stated intervals: the logarithm’s input is positive, and neither interval includes the point where the reciprocal function is undefined. Together they prove the formula on the entire domain of \(1/x\), understood one interval at a time.

Derivation: When \(x>0\), \(\ln|x|=\ln x\), whose derivative is \(1/x\). When \(x<0\), \(\ln|x|=\ln(-x)\), whose derivative is \((1/(-x))(-1)=1/x\). Therefore \(\frac{d}{dx}\ln|x|=1/x\) for every \(x\ne0\).

This proof explains why simply using \(\ln(-x)\) is not the general answer either: that expression is appropriate on the negative interval, but it is not a real-valued logarithm when \(x>0\). The absolute-value notation packages the two valid expressions into one formula.

What the Antiderivative Statement Means

An antiderivative of a function \(f\) on an interval \(I\) is a differentiable function \(F\) such that \(F'(x)=f(x)\) for every \(x\in I\). The interval matters. The formula \(1/x\) is not defined at zero, so no claim that it has an antiderivative on an interval containing zero can apply.

On either interval \((-\infty,0)\) or \((0,\infty)\), every antiderivative of \(1/x\) has the form \(\ln|x|+C\), where \(C\) is constant on that interval. This uses the standard fact that two antiderivatives of the same function on an interval differ by a constant.

$$ \int \frac{1}{x}\,dx=\ln|x|+C,\qquad x\ne0. $$

The notation is commonly written as one formula, but there is a small domain detail. The set of all nonzero real numbers is not one interval: it has a negative component and a positive component. A function can have one additive constant on the negative interval and a different additive constant on the positive interval. Thus, if describing every antiderivative on the full disconnected domain \(\mathbb{R}\setminus\{0\}\), the most precise form is

$$ F(x)= \begin{cases} \ln|x|+C_-, & x<0,\\ \ln|x|+C_+, & x>0, \end{cases} $$

where \(C_-\) and \(C_+\) are independent constants. In routine indefinite-integral notation, \(\ln|x|+C\) is the standard answer; when a single interval of integration is specified, \(C\) is the constant for that interval.

Worked Examples

Worked Example: Find an Antiderivative on a Negative Interval

Find an antiderivative of \(1/x\) for \(x<0\), and verify it.

Because \(x<0\), \(|x|=-x\). Therefore a candidate is

$$ F(x)=\ln|x|=\ln(-x). $$

Differentiate using the chain rule. The derivative of \(\ln u\) is \(u'/u\), with \(u=-x\) and \(u'=-1\):

$$ F'(x)=\frac{-1}{-x}=\frac{1}{x},\qquad x<0. $$

For a numerical check, at \(x=-2\), \(F'(-2)=1/(-2)=-1/2\), which agrees with the integrand \(1/x\) at that input. The antiderivative is valid throughout the negative interval, not just at this check point.

Worked Example: Include a Constant Multiple

Find an antiderivative of \(-4/x\) on an interval that does not contain zero, and check it.

Multiplying the basic candidate by \(-4\) gives

$$ F(x)=-4\ln|x|. $$

For \(x\ne0\), differentiate each factor:

$$ F'(x)=-4\frac{d}{dx}\ln|x| =-4\left(\frac{1}{x}\right) =-\frac{4}{x}. $$

This is the original integrand, so the candidate is verified. For instance, at \(x=2\), the derivative is \(-4/2=-2\), and the integrand is also \(-4/2=-2\). The same derivative calculation holds for negative \(x\); the absolute value keeps the logarithm real there.

Worked Example: Use Different Constants on the Two Intervals

Consider the function defined by

$$ F(x)= \begin{cases} \ln|x|+3, & x<0,\\ \ln|x|-2, & x>0. \end{cases} $$

Check whether it is an antiderivative of \(1/x\) on \(\mathbb{R}\setminus\{0\}\). On the negative interval, the constant \(3\) has derivative zero, and the logarithm has derivative \(1/x\):

$$ F'(x)=\frac{d}{dx}\bigl(\ln|x|+3\bigr) =\frac{1}{x}+0 =\frac{1}{x},\qquad x<0. $$

On the positive interval, the constant \(-2\) also has derivative zero:

$$ F'(x)=\frac{d}{dx}\bigl(\ln|x|-2\bigr) =\frac{1}{x}-0 =\frac{1}{x},\qquad x>0. $$

So \(F\) is an antiderivative at every point in its domain. The two constants need not match because zero is excluded: the domain does not connect the negative interval to the positive interval through a point where the derivative condition must hold.

A Common Mistake: Forgetting the Domain

A tempting but incomplete calculation is to write \(\int 1/x\,dx=\ln x+C\) and then use it for negative \(x\). The derivative formula \(\frac{d}{dx}\ln x=1/x\) only applies to the real-valued function \(\ln x\) where \(x>0\). For example, substituting \(x=-2\) into \(\ln x\) does not give a real number, so it cannot define a real antiderivative there.

The correction is to use \(\ln|x|\). At \(x=-2\), its value is \(\ln|-2|=\ln 2\), and its derivative on the negative interval is still \(1/x\). The absolute value does not mean the derivative is \(1/|x|\): on negative inputs the derivative of the inner expression \(-x\) contributes a factor of \(-1\), producing \(1/x\), including its negative sign.

Check the sign: For \(x<0\), \(\frac{d}{dx}\ln|x|=\frac{1}{-x}(-1)=\frac{1}{x}<0\). Replacing the answer by \(1/|x|\) would incorrectly make the derivative positive on the negative interval.

Why Zero Cannot Be Included

The absolute value makes the logarithm’s input positive at every nonzero \(x\), but at zero the input is \(|0|=0\). The real natural logarithm is not defined at zero. Independently, \(1/x\) is also undefined at zero. Thus the formula is not an antiderivative at zero, and it cannot be applied across an interval containing zero as though the reciprocal function were defined throughout.

When using the formula, first identify the interval on which the integrand is defined. If that interval lies wholly to one side of zero, \(\ln|x|+C\) gives the antiderivatives there. If a problem describes both sides, keep in mind that the constants can be chosen separately on the two components.

Check Your Understanding

Use the derivative and domain checks from this tutorial to answer the following.

  1. For \(x<0\), rewrite \(\ln|x|\) without absolute-value bars and differentiate the result.
  2. Why is \(\ln x+C\) not a real antiderivative formula for \(1/x\) on a negative interval?
  3. Differentiate \(\ln|x|\) for \(x>0\), and state the interval on which your calculation applies.
  4. Can one antiderivative on \(\mathbb{R}\setminus\{0\}\) use different additive constants on the negative and positive intervals? Explain why.
  5. What prevents the formula \(\ln|x|+C\) from giving an antiderivative at \(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