Derivative of ln(x) – the Logarithm Rule
The derivative of the natural logarithm is $\dfrac{d}{dx}\ln(x) = \dfrac{1}{x}$ for $x > 0$. For a logarithm of a function, $\ln(f(x))$, the chain rule gives $\dfrac{f'(x)}{f(x)}$ – "derivative of the inside over the inside".
📜 The formulas
The special case $a = 10$ gives $\dfrac{d}{dx}\log_{10}(x) = \dfrac{1}{x\ln 10} \approx \dfrac{0.4343}{x}$.
Note: in many programming languages and in this calculator log(x) means the natural logarithm $\ln(x)$.
🔍 Why is the derivative of ln(x) equal to 1/x?
The quickest proof uses the fact that $\ln$ is the inverse function of $e^x$. Start from
Differentiate both sides with respect to $x$. On the left the chain rule gives $e^{y}\cdot y'$, on the right we get $1$:
For $\ln|x|$ with $x<0$ we have $\ln|x| = \ln(-x)$, and the chain rule gives $\frac{1}{-x}\cdot(-1) = \frac{1}{x}$ – the same formula. For another base use $\log_a(x) = \dfrac{\ln x}{\ln a}$: the constant $\frac{1}{\ln a}$ simply stays as a factor (constant factor rule).
🔗 Derivative of ln of a function: ln(f(x))
When the argument is more than just $x$, combine the logarithm rule with the chain rule:
- Outer derivative Write $\dfrac{1}{\text{inside}}$ – the inside stays unchanged.
- Inner derivative Differentiate the inside $f(x)$.
- Multiply $\dfrac{1}{f(x)}\cdot f'(x) = \dfrac{f'(x)}{f(x)}$, then simplify.
💡 Before differentiating, the logarithm laws often make the work much shorter: $\ln(ab) = \ln a + \ln b$, $\ln\frac{a}{b} = \ln a - \ln b$, $\ln(a^n) = n\ln a$.
✏️ Worked examples
Example 1: $\ln(2x)$
Chain rule: $\dfrac{1}{2x}\cdot 2 = \dfrac{1}{x}$. Alternatively $\ln(2x) = \ln 2 + \ln x$, and $\ln 2$ is a constant.
$\dfrac{d}{dx}\ln(2x) = \dfrac{1}{x}$
Example 2: $\ln(x^2+1)$
Inside $f(x) = x^2+1$, $f'(x) = 2x$:
$\dfrac{d}{dx}\ln(x^2+1) = \dfrac{2x}{x^2+1}$
Example 3: $\ln(x^3)$
Log law first: $\ln(x^3) = 3\ln x$, so the derivative is $3\cdot\frac{1}{x}$.
$\dfrac{d}{dx}\ln(x^3) = \dfrac{3}{x}$
Example 4: $\ln(\sin x)$
Inside $\sin x$, inner derivative $\cos x$:
$\dfrac{d}{dx}\ln(\sin x) = \dfrac{\cos x}{\sin x} = \cot x$
Example 5: $x\ln x$
A product – use the product rule with $u = x$, $v=\ln x$: $1\cdot\ln x + x\cdot\frac{1}{x}$.
$\dfrac{d}{dx}\big(x\ln x\big) = \ln x + 1$
Example 6: $(\ln x)^2$
Here the logarithm is inside a square: outer derivative $2\ln x$, inner derivative $\frac{1}{x}$.
$\dfrac{d}{dx}(\ln x)^2 = \dfrac{2\ln x}{x}$
Example 7: $\log_2(x)$ and $\log_{10}(5x)$
$\dfrac{d}{dx}\log_2 x = \dfrac{1}{x\ln 2}$. For $\log_{10}(5x) = \log_{10}5 + \log_{10}x$ only the second term depends on $x$:
$\dfrac{d}{dx}\log_{10}(5x) = \dfrac{1}{x\ln 10}$
🧠 Logarithmic differentiation
Functions with $x$ in the base and in the exponent, like $x^x$, cannot be handled by the power rule or the exponential rule. Take the logarithm first:
The same trick simplifies long products and quotients, because the logarithm turns them into sums. See $x^x$ step by step in the calculator.
⚠️ Common mistakes
Forgetting the inner derivative: $\frac{d}{dx}\ln(3x^2) \neq \frac{1}{3x^2}$. Correct: $\frac{6x}{3x^2} = \frac{2}{x}$.
Mixing up $\ln(x^2)$ and $(\ln x)^2$: the first has derivative $\frac{2}{x}$, the second $\frac{2\ln x}{x}$.
Thinking the derivative of $\ln 5$ is $\frac15$: $\ln 5$ is a number, so its derivative is $0$.
Ignoring the domain: $\ln x$ is only defined for $x>0$; use $\ln|x|$ if negative values are allowed.
🧮 Try it with the step-by-step calculator
Open any of these examples in the calculator to see every single differentiation step:
Or enter your own function on the derivative calculator.
❓ Frequently asked questions
What is the derivative of ln(x)?
$\frac{d}{dx}\ln(x) = \frac{1}{x}$ for $x>0$. The same formula holds for $\ln|x|$ for all $x\neq 0$.
What is the derivative of ln(2x)?
$\frac{1}{x}$. By the chain rule $\frac{1}{2x}\cdot 2 = \frac{1}{x}$; or note that $\ln(2x) = \ln 2 + \ln x$ and the constant $\ln 2$ disappears.
What is the derivative of ln(f(x))?
$\frac{f'(x)}{f(x)}$ – the derivative of the inside divided by the inside. Example: $\frac{d}{dx}\ln(x^2+1) = \frac{2x}{x^2+1}$.
What is the derivative of log base 10 of x?
$\frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10}$. In general $\frac{d}{dx}\log_a x = \frac{1}{x\ln a}$.
What is the derivative of ln(ln(x))?
Chain rule: $\frac{1}{\ln x}\cdot\frac{1}{x} = \frac{1}{x\ln x}$ (for $x>1$).
What is the second derivative of ln(x)?
The first derivative is $x^{-1}$, so the second derivative is $-x^{-2} = -\frac{1}{x^2}$.
Is the derivative of ln(x) the same as the integral of 1/x?
They are inverse operations: since $(\ln|x|)' = \frac1x$, an antiderivative of $\frac1x$ is $\ln|x| + C$.