What is the integral of 1/x?
What is the integral of $\frac{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)|$?
Solution 1:
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$}$$
Solution 2:
Answers to the question of the integral of $\frac{1}{x}$ are all based on an implicit assumption that the upper and lower limits of the integral are both positive real numbers. If we allow more generality, we find an interesting paradox. For instance, suppose the limits on the integral are from $-A$ to $+A$ where $A$ is a real, positive number. The posted answer in term of $\ln$ would give
$\ln(A) - \ln(-A) = \ln\left(\frac{A}{-A}\right) = \ln(-1) = i* \pi$ a complex number --- rather strange.
Now if you do the same integral from $-$ to $+$ infinity (i.e. $A = \infty$) using Contour Integration, you get $i*2\pi$ or twice the above value.
If you use simple reasoning, and also numerical integration, this integral for any value of $A$ ( as long as the limits are $-A$ to $+A$ is clearly $0$. So one must be careful in evaluating real integrals with a singularity of this kind. Same applies to any integral of $\frac{1}{x - k}$ where $k$ is any constant real number) or