Math Help - integral of 1/x

1. integral of 1/x

Hi,

I understand that differentiate both ln x and ln |x| will give 1/x.
But why $\int \frac{1}{x} dx=ln|x|+c$.
Is it ok if I write $\int \frac{1}{x} dx=ln x+c$

Can someone help?

2. Originally Posted by acc100jt
Hi,

I understand that differentiate both ln x and ln |x| will give 1/x.
But why $\int \frac{1}{x} dx=ln|x|+c$.
Is it ok if I write $\int \frac{1}{x} dx=ln x+c$

Can someone help?
It depends on the interval x is defined on.

If $x\in\left(0,\infty\right)$, then its safe to say that $\int\frac{1}{x}\,dx=\ln x+C$. However, if $x\in\left(-\infty,0\right)$, then $\int\frac{1}{x}\,dx=\ln\left(-x\right)+C$.

Thus, it would be best to define $\int\frac{1}{x}\,dx=\ln\!\left|x\right|+C$ for $x\in\mathbb{R}\backslash\{0\}$ (any real number except zero)