What is the derivative of $\ln|x|$? I am somewhat confused about finding the derivative of $\ln|x|$. Is it $1/|x|$ or $1/x$? 
What if instead of $x$ we have a general function $f(x)$? Most importantly: why?
It's $\,\dfrac 1x$. Indeed, if $x&lt;0$, $\bigl(\ln\lvert x \rvert\bigr)'=\bigl(\ln(-x)\bigr)'=\dfrac1{-x}\times -1$ by the chain rule.
It's $\frac{1}{x}$ (for positive $x$ value, for negative $x$ you would need the absolute value) , the derivative itself can be derived from the fact that derivative of $e^{x}$ is also $e^{x}$ (by letting $y = ln(x)$, so $x = e^{y}$, then you can derive the derivative of $\ln(x)$ with implicit differentiation), you can also do the formal definition of derivative to get it, using logarithm properties and also the limit definition of $e^{x}$ (you will need those two thing if you're using the formal definition of derivative)