# Antiderivative of 1/x: ln(x) or ln(|x|)?

• Alettix
In summary, the antiderivative of 1/x can be expressed as ln(x) or ln(|x|), depending on the domain of the function. Both ln(x) and ln(|x|) are valid antiderivatives and differ by a constant. However, if the function has a discontinuity at x=0, ln(x) should be used as the antiderivative. Other expressions such as ln|x| + C or log|x| + C can also be used as antiderivatives, where C is a constant.
Alettix

## Homework Statement

Calculate the integral:
## \int_{a}^{b} \frac{1}{x} dx ##

-

## The Attempt at a Solution

In high school we learned that:
## \int_{a}^{b} \frac{1}{x} dx = ln(|x|) + C ##
because the logarithm of a negative number is undefined.

However, in my current maths course about complex numbers we leared to take the logarithms of negative numbers as well, using: ##ln(-x) = ln(x) + \pi i ##. With this extension, can we say:
## \int_{a}^{b} \frac{1}{x} dx = ln(x) + C ##
or is this still wrong?

Thank you very much!

If ##a=b## the integral exists, trivially, and is equal to zero.
If ##a<0<b## the definite integral does not exist because the explosion at 0 makes the function not integrable over the interval ##[a,b]##.
If ##a<b=0## or ##0=a<b## is 0, the proper integral does not exist because ##\log 0## and ##\log|0|## are undefined. The improper integral doesn't exist either, since ##\lim_{x\to 0}\log x## and ##\lim_{x\to 0}\log |x|## do not exist.

If ##0<a<b## then the integral exists and both formulas give the same result, since on that range of integration ##|x|=x##.

If ##a<b<0##, again the integral exists and gives the same result from both formulas, because the constant ##\pi i## cancels out.

PS:
Alettix said:
With this extension, can we say:
## \int_{a}^{b} \frac{1}{x} dx = ln(x) + C ##
or is this still wrong?
For one-dimensional integration the integration constant ##C## should not be used in a definite integral. It is used in an indefinite integral, but always cancels out when one makes a definite integral (ie inserts lower and upper integration limits).

Alettix
@Alettix, please post problems involving integrals and other calculus topics in the Calculus & Beyond section, not the Precalc section where you posted this thread. I have moved your thread.

Alettix said:

## Homework Statement

Calculate the integral:
## \int_{a}^{b} \frac{1}{x} dx ##

-

## The Attempt at a Solution

In high school we learned that:
## \int_{a}^{b} \frac{1}{x} dx = ln(|x|) + C ##
because the logarithm of a negative number is undefined.

However, in my current maths course about complex numbers we leared to take the logarithms of negative numbers as well, using: ##ln(-x) = ln(x) + \pi i ##. With this extension, can we say:
## \int_{a}^{b} \frac{1}{x} dx = ln(x) + C ##
or is this still wrong?

Thank you very much!

If $a < b < 0$ then $$\int_{a}^{b} \frac1x\,dx = \left[ \ln x \right]_{a}^{b} = \left[ \ln|x| + i\pi \right]_{a}^{b} = \ln|b| - \ln|a|,$$ consistent with the first rule you were taught. Integrals where $a < 0 < b$ are not defined due to the singularity at the origin.

Alettix
If we're talking about complex numbers, we have ##\ln b - \ln a##.
If we're talking about real numbers, we need to consider the undefined point we have at 0, so that ##a## and ##b## both have to be either positive, or negative.
Otherwise we have to get to more "tricks" to deal with the discontinuity.
Either way, ##\ln |x| + C## is a poor man's anti-derivative since the integration constant can be different on either side of ##0##.

Alettix said:

## Homework Statement

Calculate the integral:
## \int_{a}^{b} \frac{1}{x} dx ##

-

## The Attempt at a Solution

In high school we learned that:
## \int_{a}^{b} \frac{1}{x} dx = ln(|x|) + C ##
because the logarithm of a negative number is undefined.

However, in my current maths course about complex numbers we leared to take the logarithms of negative numbers as well, using: ##ln(-x) = ln(x) + \pi i ##. With this extension, can we say:
## \int_{a}^{b} \frac{1}{x} dx = ln(x) + C ##
or is this still wrong?

Thank you very much!

I hope nobody in high school told you that formula, because you have ##a## and ##b## on one side but no ##a## or ##b## on the other side of the equation. That cannot be right.

Anyway, if ##0 < a < b##. then ##|x| = x## for any ##x## between ##a## and ##b##, so it makes no difference whether you use ##\ln |x|## or ##\ln x##. If ##a < b < 0## the integral ##\int_a^b dx/x## computes the (negative) area from ##x = a## to ##x = b## below the ##x##-axis and above the curve ##y = 1/x## (which lies below the axis). If you put ##t = -x## the integral becomes ##\int_{-a}^{-b} (-dt)/(-t)),## which equals ##\int_{|a|}^{|b|} dt/t = \ln |b| - \ln |a| < 0## because ##|b| < |a|##. That is as it should be.

Last edited:

## 1. What is the antiderivative of 1/x?

The antiderivative of 1/x is ln(x) or ln(|x|). Both expressions are considered to be equivalent and valid antiderivatives.

## 2. How do you know which antiderivative to use?

The choice between ln(x) and ln(|x|) as the antiderivative of 1/x depends on the domain of the function. If the function is defined for all real numbers, then ln(x) is used. However, if the function is defined only for positive numbers, then ln(|x|) is used.

## 3. Can both ln(x) and ln(|x|) be used as antiderivatives at the same time?

Yes, both ln(x) and ln(|x|) are valid antiderivatives of 1/x. However, they differ by a constant, so the choice between them does not affect the final result.

## 4. Is there a specific situation where ln(x) should be used over ln(|x|) as the antiderivative of 1/x?

Yes, if the function has a discontinuity at x=0, then ln(x) should be used as the antiderivative. This is because ln(|x|) is not continuous at x=0, whereas ln(x) is.

## 5. Are there any other antiderivatives of 1/x besides ln(x) and ln(|x|)?

There are other antiderivatives of 1/x, but they can be expressed in terms of ln(x) and ln(|x|). For example, the antiderivative can also be written as ln|x| + C or log|x| + C, where C is a constant.

• Calculus and Beyond Homework Help
Replies
6
Views
663
• Calculus and Beyond Homework Help
Replies
54
Views
8K
• Calculus and Beyond Homework Help
Replies
14
Views
2K
• Calculus and Beyond Homework Help
Replies
3
Views
440
• Calculus and Beyond Homework Help
Replies
9
Views
670
• Calculus and Beyond Homework Help
Replies
2
Views
935
• Calculus and Beyond Homework Help
Replies
23
Views
1K
• Calculus and Beyond Homework Help
Replies
4
Views
716
• Calculus and Beyond Homework Help
Replies
12
Views
1K
• Calculus and Beyond Homework Help
Replies
3
Views
6K