Why $\int \frac{1}{x}$ is $\ln|x| + C$ not $\ln(x) + C$?

111 Views Asked by At

I am reading about indefinite integrals and I have a question regarding the use of the modulus in integrating $\frac{1}{x}$.

The book I am reading gives me the following explanation -

enter image description here

The book later gives no further explanation, which has left me confused.

I have found no reasonable explanation online, so I would like to ask why this is the case in integration.

What does the book cite as "difficulties that may arise"?

2

There are 2 best solutions below

1
On BEST ANSWER

Hint. The function $1/x$ is integrable on the negative numbers. For example, evaluate $$\int_{-2}^{-1}\frac1x\,\mathrm dx$$

0
On

The domain of $\frac1x$ is $\mathbb{R}\setminus\{0\}$. Therefore, the domain of any primitive must also be $\mathbb{R}\setminus\{0\}$. So, the answer could never be $\ln x+C$, since this is definid on $(0,+\infty)$ only.

On the other hand, $$\ln\bigl(|x|\bigr)=\begin{cases}\ln x&\text{ if }x>0\\\ln(-x)&\text{ if }x<0.\end{cases}$$Therefore, if you differentiate it, you get$$\begin{cases}\frac1x&\text{ if }x>0\\\frac{-1}{-x}&\text{ if }x<0\end{cases}=\frac1x.$$