# Do you need absolute value around argument for log and ln?

#### find_the_fun

##### Active member
When I learned about derivatives I was taught to put the absolute value sign around the argument for ln and log. For example $$\displaystyle \log{|x|}$$ and $$\displaystyle \ln{|x|}$$ instead of $$\displaystyle log(x)ln(x)$$. Does this make a difference? Should both brackets and the straight lines be used?

When taking the derivative what is the effect on the absolute sign? For example if I write $$\displaystyle \ln{|x|}$$ would it be incorrect if I didn't write $$\displaystyle \frac{1}{|x|}$$

#### Klaas van Aarsen

##### MHB Seeker
Staff member
When I learned about derivatives I was taught to put the absolute value sign around the argument for ln and log. For example $$\displaystyle \log{|x|}$$ and $$\displaystyle \ln{|x|}$$ instead of $$\displaystyle log(x)ln(x)$$. Does this make a difference? Should both brackets and the straight lines be used?
It is merely more general.
I don't usually use absolute value signs myself.
That is, until I may want to generalize my result to negative x, but usually there is no reason to.

When taking the derivative what is the effect on the absolute sign? For example if I write $$\displaystyle \ln{|x|}$$ would it be incorrect if I didn't write $$\displaystyle \frac{1}{|x|}$$
Yes. Assuming that you mean by $\ln|x|$ a function that is defined both for positive x and for negative x, that means that the derivative must be $\frac {1}{|x|}$, which is also defined both for positive and negative x.
You can only leave out the absolute value signs if you limit your domain to positive x.

EDIT: My mistake. See Prove It's comment below. The absolute signs should not be there.

Btw, there is a catch.
The indefinite integral of $\frac {1}{x}$ is often denoted as $\ln|x| + C$.
But this is not quite correct.
That is because the integration constant can be different for positive x and for negative x.

#### Prove It

##### Well-known member
MHB Math Helper
It is merely more general.
I don't usually use absolute value signs myself.
That is, until I may want to generalize my result to negative x, but usually there is no reason to.

Yes. Assuming that you mean by $\ln|x|$ a function that is defined both for positive x and for negative x, that means that the derivative must be $\frac {1}{|x|}$, which is also defined both for positive and negative x.
Ah, no, this should be stricken from the record.

The derivative of \displaystyle \begin{align*} \ln{(x)} \end{align*} is \displaystyle \begin{align*} \frac{1}{x} \end{align*}. Notice how here we have that \displaystyle \begin{align*} x > 0 \end{align*} in order for the logarithm to be defined.

Notice too that the derivative of \displaystyle \begin{align*} \ln{(-x)} \end{align*} is also \displaystyle \begin{align*} \frac{1}{x} \end{align*}. Don't believe me, use the Chain Rule. Notice that here we have \displaystyle \begin{align*} x < 0 \end{align*} for the logarithm to be defined.

Thus, if we go in reverse, we have \displaystyle \begin{align*} \int{\frac{1}{x}\,dx} = \ln{(x)} \end{align*} IF \displaystyle \begin{align*} x > 0 \end{align*} and \displaystyle \begin{align*} \ln{(-x)} \end{align*} IF \displaystyle \begin{align*} x < 0 \end{align*}.

That sounds an awful lot like the definition of an absolute value to me...

So to summarise \displaystyle \begin{align*} \int{\frac{1}{x}\,dx} = \ln{|x|} + C \end{align*}

There is NO reason (and in fact it is completely incorrect) to put \displaystyle \begin{align*} \frac{1}{|x|} \end{align*}.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Ah, no, this should be stricken from the record.
My mistake.
I'll put an EDIT note in my previous post.
As I said, I don't usually use those absolute signs.

#### topsquark

##### Well-known member
MHB Math Helper
On the other hand, y = ln |x| has two branches, one on the +x axis and one on the -x axis. y = ln(x) only has the branch on the +x side. I think that makes it rather different.

$$\displaystyle \int \frac{1}{x}~dx = ln |x| + C$$
is defined on all values of x (except for x = 0, of course) not just the +xs.

-Dan

Sorry ProveIt. I missed your post somehow.

Last edited: