In algorithms, log factors come up a lot. I always forget what to do whether you derivate or integrate, when log x becomes 1/x and so on.
What's the derivation of this rule so I can never forget what to do when encountering logs in derivates or integrals?
If you remember $\frac{d}{dx} e^x = e^x$, then you can do implicit differentiation.
\begin{align} y &= \log x\\ e^y &= x\\ \frac{d}{dx} e^y &= 1\\ e^y \frac{dy}{dx} &= 1\\ \frac{dy}{dx} &= \frac{1}{e^y} = \frac{1}{x}. \end{align}
The indefinite integral $\int \log x \mathop{dx} = x \log x - x$ can be derived using integration by parts, or (if you remembered the antiderivative correctly) by checking that the derivative of $x \log x - x$ is indeed $\log x$.