TITLE: Demystify integration of $\int \frac{1}{x} \mathrm dx$
QUESTION [92 upvotes]: I've learned in my analysis class, that

$$ \int \frac{1}{x} \mathrm dx = \ln(x). $$

I can live with that, and it's what I use when solving equations like that.
But how can I solve this, without knowing that beforehand.
Assuming the standard rule for integration is

$$ \int x^a \, \mathrm dx = \frac{1}{a+1} \cdot x^{a+1} + C .$$

If I use that and apply this to $\int \frac{1}{x} \,\mathrm dx$:
$$ \begin{align*}
  \int \frac{1}{x}\mathrm  dx &= \int x^{-1} \,\mathrm dx \\
                      &= \frac{1}{-1+1} \cdot x^{-1+1} \\
                      &= \frac{x^0}{0}
\end{align*} $$
Obviously, this doesn't work, as I get a division by $0$. I don't really see, how I can end up with $\ln(x)$. There seems to be something very fundamental that I'm missing.
I study computer sciences, so, we usually omit things like in-depth math theory like that. We just learned that $\int \frac{1}{x} dx = \ln(x)$ and that's what we use.

REPLY [2 votes]: In my opinion, the primitive of the function $1/x$ has to be studied without mentioning the exponential function $e^x$. Indeed, the exponential function is the inverse function of the primitive of $1/x$ function. This recalls the story of the chicken and the egg: what we consider as known, $e^x$ or $\ln (x)$ ?