This is a question that I've had for a while now. I feel like it should be easy, but I can't figure it out. Why is $\ln|x| = \int \frac{1}{x}$? Furthermore, why does $x$ become $|x|$ after integration?
Extra question: $\int_a^b \frac{1}{x} = \ln|x||_a^b = \ln|b| - \ln|a| = \ln|-b| - \ln|-a| = \int_{-a}^{-b} \frac{1}{x}$ holds, right? (for $a,b \neq 0$)
Integration is the opposite to differentiation. If $x > 0$, then $$ \frac{d}{dx} \ln(x) = \frac 1x .$$ If $x < 0$, then $$ \frac{d}{dx} \ln(-x) = -\frac 1{-x} = \frac1x .$$ So $$ \frac{d}{dx} \ln|x| = \frac 1x .$$ And you are correct about the second part. (If you draw a picture, it will confirm you are correct.)