So far, we have learned how to differentiate a variety of functions, including trigonometric, inverse, and implicit functions. In this section, we explore derivatives of logarithmic functions. Logarithmic functions can help rescale large quantities and are particularly helpful for rewriting complicated expressions.
Derivative of the Logarithmic Function
Now that we have the derivative of the natural exponential function, we can use implicit differentiation to find the derivative of its inverse, the natural logarithmic function.
Theorem: The Derivative of the Natural Logarithmic Function
If \(x>0\) and \(y=\ln x\),then
\(\frac{dy}{dx}=\frac{1}{x}\).
If \(x ≠ 0\) and \(y=\ln |x|\),then
\(\frac{dy}{dx}=\frac{1}{x}\).
Suppose the argument of the natural log is not just \(x\), but instead is \(g(x)\), a differentiable function. Now, using the chain rule, we get a more general derivative: for all values of \(x\) for which \(g(x)>0\), the derivative of \(h(x)=ln(g(x))\) is given by
\(h′(x)=\frac{1}{g(x)}g′(x).\)
Proof
If \(x>0\) and \(y=\ln x\), then \(e^y=x.\) Differentiating both sides of this equation results in the equation
\(e^y\frac{dy}{dx}=1.\)
Solving for \(\frac{dy}{dx}\) yields
\(\frac{dy}{dx}=\frac{1}{e^y}\).
Finally, we substitute \(x=e^y\) to obtain
\(\frac{dy}{dx}=\frac{1}{x}\).
We may also derive this result by applying the inverse function theorem, as follows. Since \(y=g(x)=lnx\)
is the inverse of \(f(x)=e^x\), by applying the inverse function theorem we have
\(\frac{dy}{dx}=\frac{1}{f′(g(x))}=\frac{1}{e^{\ln x}}=\frac{1}{x}\).
Using this result and applying the chain rule to \(h(x)=\ln (g(x))\) yields
\(h′(x)=\frac{1}{g(x)}g′(x)\).
□
The graph of \(y=lnx\) and its derivative \(\frac{dy}{dx}=\frac{1}{x}\) are shown in Figure.

Figure \(\PageIndex{3}\): The function \(y=\ln x\) is increasing on \((0,+∞)\). Its derivative \(y'=\frac{1}{x}\) is greater than zero on \((0,+∞)\)
Example \(\PageIndex{1}\):Taking a Derivative of a Natural Logarithm
Find the derivative of \(f(x)=\ln (x^3+3x−4)\).
Solution
Use Equation directly.
\(f′(x)=\frac{1}{x^3+3x−4}⋅(3x^2+3)\) Use \(g(x)=x^3+3x−4\) in \(h′(x)=\frac{1}{g(x)}g′(x)\).
\(=\frac{3x^2+3}{x^3+3x−4}\) Rewrite.
Example \(\PageIndex{2}\):Using Properties of Logarithms in a Derivative
Find the derivative of \(f(x)=\ln (\frac{x^2\sin x}{2x+1})\).
Solution
At first glance, taking this derivative appears rather complicated. However, by using the properties of logarithms prior to finding the derivative, we can make the problem much simpler.
\(f(x)=\ln (\frac{x^2\sin x}{2x+1})=2\ln x+\ln (\sin x)−\ln (2x+1)\) Apply properties of logarithms.
\(f′(x)=\frac{2}{x}+\cot x−\frac{2}{2x+1}\) Apply sum rule and \(h′(x)=\frac{1}{g(x)}g′(x)\).
Exercise \(\PageIndex{1}\)
Differentiate: \(f(x)=\ln (3x+2)^5\).
- Hint
-
Use a property of logarithms to simplify before taking the derivative.
- Answer
-
\(f′(x)=\frac{15}{3x+2}\)
Now that we can differentiate the natural logarithmic function, we can use this result to find the derivatives of \(y=log_bx\) and \(y=b^x\) for \(b>0,b≠1\).
Derivatives of General Exponential and Logarithmic Functions
Let \(b>0,b≠1,\) and let \(g(x)\) be a differentiable function.
i. If, \(y=log_bx\), then
\(\frac{dy}{dx}=\frac{1}{x\ln b}\).
More generally, if \(h(x)=log_b(g(x))\), then for all values of x for which \(g(x)>0\),
\(h′(x)=\frac{g′(x)}{g(x)\ln b}\).
ii. If \(y=b^x,\) then
\(\frac{dy}{dx}=b^x\ln b\).
More generally, if \(h(x)=b^{g(x)},\) then
\(h′(x)=b^{g(x)}g''(x)\ln b\)
Proof
If \(y=log_bx,\) then \(b^y=x.\) It follows that \(\ln (b^y)=\ln x\). Thus \(y\ln b=\ln x\). Solving for \(y\), we have \(y=\frac{\ln x}{\ln b}\). Differentiating and keeping in mind that \(\ln b\) is a constant, we see that
\(\frac{dy}{dx}=\frac{1}{x\ln b}\).
The derivative in Equation now follows from the chain rule.
If \(y=b^x\). then \(\ln y=x\ln b.\) Using implicit differentiation, again keeping in mind that \(\ln b\) is constant, it follows that \(\frac{1}{y}\frac{dy}{dx}=\ln b\). Solving for \(\frac{dy}{dx}\) and substituting \(y=b^x\), we see that
\(\frac{dy}{dx}=y\ln b=b^x\ln b\).
The more general derivative (Equation) follows from the chain rule.
□
Example \(\PageIndex{3}\):Applying Derivative Formulas
Find the derivative of \(h(x)=\frac{3^x}{3^x+2}\).
Solution
Use the quotient rule and Note.
\(h′(x)=\frac{3^x\ln 3(3^x+2)−3^x\ln 3(3^x)}{(3^x+2)^2}\) Apply the quotient rule.
\(=\frac{2⋅3^x\ln 3}{(3x+2)^2}\) Simplify.
Example \(\PageIndex{4}\): Finding the Slope of a Tangent Line
Find the slope of the line tangent to the graph of \(y=log_2(3x+1)\) at \(x=1\).
Solution
To find the slope, we must evaluate \(\frac{dy}{dx}\) at \(x=1\). Using Equation, we see that
\(\frac{dy}{dx}=\frac{3}{\ln 2(3x+1)}\).
By evaluating the derivative at \(x=1\), we see that the tangent line has slope
\(\frac{dy}{dx}∣_{x=1}=\frac{3}{4\ln 2}=\frac{3}{\ln16}\).
Exercise \(\PageIndex{2}\)
Find the slope for the line tangent to \(y=3^x\) at \(x=2.\)
- Hint
-
Evaluate the derivative at \(x=2.\)
- Answer
-
\(9\ln (3)\)