# What is the integral of 1/x?

What is the integral of $1/x$? Do you get $\ln(x)$ or $\ln|x|$?

In general, does integrating $f'(x)/f(x)$ give $\ln(f(x))$ or $\ln|f(x)|$?

Also, what is the derivative of $|f(x)|$? Is it $f'(x)$ or $|f'(x)|$?

-
@Potato Fair enough. –  M Turgeon Oct 2 '12 at 15:19
This question is missing the domain of definition, when working in complex domain the restriction for $\ln x$ is not required –  Arjang Feb 10 '13 at 2:05
In summary, the answer is not $\log x$, $\log |x|$, or "$\log |x| + C$". The answer is that $F'(x)=1/x$ on $\mathbb{R}$ implies that there are constants $C_1,C_2\in\mathbb{R}$ such that $F(x)=\log(x)+C_1$ for all $x>0$ and $F(x)=\log(-x)+C_2$ for all $x<0$. There is no such thing as "the integral of $1/x$". –  wj32 Feb 10 '13 at 2:09

You have $$\int {1\over x}{\rm d}x=\ln|x|+C$$ (Note that the "constant" $C$ might take different values for positive or negative $x$. It is really a locally constant function.)
In the same way, $$\int {f'(x)\over f(x)}{\rm d}x=\ln|f(x)|+C$$ The last derivative is given by $${{\rm d}\over {\rm d}x}|f(x)|={\rm sgn}(f(x))f'(x)=\cases{f'(x) & if f(x)>0 \cr -f'(x) & if f(x)<0}$$