Skip to main content
Mathematics LibreTexts

2.10: The Natural Logarithm

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The chain rule opens the way to understanding derivatives of more complicated function. Not only compositions of known functions as we have seen the examples of the previous section, but also functions which are defined implicitly.

    Consider the logarithm base \(e\) — \(\log_e(x)\) is the power that \(e\) must be raised to to give \(x\text{.}\) That is, \(\log_e(x)\) is defined by

    \begin{align*} e^{\log_e x} &= x \end{align*}

    i.e. — it is the inverse of the exponential function with base \(e\text{.}\) Since this choice of base works so cleanly and easily with respect to differentiation, this base turns out to be (arguably) the most natural choice for the base of the logarithm. And as we saw in our whirlwind review of logarithms in Section 2.7, it is easy to use logarithms of one base to compute logarithms with another base:

    \begin{align*} \log_q x &= \frac{\log_e x}{\log_e q} \end{align*}

    So we are (relatively) free to choose a base which is convenient for our purposes.

    The logarithm with base \(e\text{,}\) is called the “natural logarithm”. The “naturalness” of logarithms base \(e\) is exactly that this choice of base works very nicely in calculus (and so wider mathematics) in ways that other bases do not 1. There are several different “standard” notations for the logarithm base \(e\text{;}\)

    \begin{gather*} \log_e x = \log x = \ln x. \end{gather*}

    We recommend that you be able to recognise all of these.

    In this text we will write the natural logarithm as “\(\log\)” with no base. The reason for this choice is that base \(e\) is the standard choice of base for logarithms in mathematics 2

    The natural logarithm inherits many properties of general logarithms 3. So, for all \(x,y \gt 0\) the following hold:

    • \(e^{\log x}=x\text{,}\)
    • for any real number \(X\text{,}\) \(\log \big(e^X\big)=X\text{,}\)
    • for any \(a \gt 1\text{,}\) \(\log_a x=\tfrac{\log x}{\log a}\) and \(\log x=\tfrac{\log_a x}{\log_a e}\)
    • \(\log 1=0\text{,}\) \(\log e=1\)
    • \(\log(xy)=\log x+\log y\)
    • \(\log\big(\tfrac{x}{y}\big)=\log x-\log y\text{,}\) \(\log\big(\tfrac{1}{y}\big)=-\log y\)
    • \(\log(x^X)=X\log x\)
    • \(\lim\limits_{x\rightarrow\infty}\log x=\infty\text{,}\) \(\lim\limits_{x\rightarrow0}\log x=-\infty\)

    And finally we should remember that \(\log x\) has domain (i.e. is defined for) \(x \gt 0\) and range (i.e. takes all values in) \(-\infty \lt x \lt \infty\text{.}\)

    To compute the derivative of \(\log x\) we could attempt to start with the limit definition of the derivative

    \begin{align*} \dfrac{d}{dx}\log x &= \lim_{h \to 0} \frac{\log(x+h) - \log(x)}{h}\\ &= \lim_{h\to 0} \frac{\log( (x+h)/x )}{h}\\ &= \text{um\dots} \end{align*}

    This doesn't look good. But all is not lost — we have the chain rule, and we know that the logarithm satisfies the equation:

    \begin{align*} x &= e^{\log x} \end{align*}

    Since both sides of the equation are the same function, both sides of the equation have the same derivative. i.e. we are using 4

    \begin{gather*} \text{ if } f(x)=g(x) \text{ for all $x$, then } f'(x) = g'(x) \end{gather*}

    So now differentiate both sides:

    \begin{align*} \dfrac{d}{dx} x &= \dfrac{d}{dx} e^{\log x}\\ \end{align*}

    The left-hand side is easy, and the right-hand side we can process using the chain rule with \(f(u)=e^u\) and \(u=\log x\text{.}\)

    \begin{align*} 1 &= \dfrac{df}{du} \cdot \dfrac{du}{dx}\\ &= e^u \cdot \underbrace{\dfrac{d}{dx} \log x }_\text{what we want to compute}\\ \\ \end{align*}

    Recall that \(e^u = e^{\log x} = x\text{,}\) so

    \begin{align*} 1 &= x \cdot \underbrace{\dfrac{d}{dx} \log x }_\text{now what?}\\ \end{align*}

    We can now just rearrange this equation to make the thing we want the subject:

    \begin{align*} \dfrac{d}{dx} \log x &= \frac{1}{x} \end{align*}

    Thus we have proved:

    Theorem 2.10.1.

    \begin{align*} \dfrac{d}{dx} \log x &= \frac{1}{x} \end{align*}

    where \(\log x\) is the logarithm base \(e\text{.}\)

    Example 2.10.2 The derivative of \(\log 3x\).

    Let \(f(x) = \log 3x\text{.}\) Find \(f'(x)\text{.}\)

    There are two ways to approach this — we can simplify then differentiate, or differentiate and then simplify. Neither is difficult.

    • Simplify and then differentiate:

      \begin{align*} f(x) &= \log 3x & \text{log of a product}\\ &= \log 3 + \log x\\ f'(x) &= \dfrac{d}{dx} \log 3 + \dfrac{d}{dx} \log x\\ &= \frac{1}{x}. \end{align*}

    • Differentiation and then simplify:

      \begin{align*} f'(x) &= \dfrac{d}{dx} \log(3x) & \text{chain rule}\\ &= \frac{1}{3x} \cdot 3\\ &= \frac{1}{x} \end{align*}

    Example 2.10.3 The derivative of \(\log cx\).

    Notice that we can extend the previous example for any positive constant — not just 3. Let \(c\gt 0\) be a constant, then

    \begin{align*} \dfrac{d}{dx} \log cx &= \dfrac{d}{dx}\left(\log c + \log x \right)\\ &= \frac{1}{x} \end{align*}

    Example 2.10.4 The derivative of \(\log|x|\).

    We can push this further still. Let \(g(x) = \log | x |\text{,}\) then 5

    • If \(x \gt 0\text{,}\) \(|x|= x\) and so

      \begin{align*} g'(x) &= \dfrac{d}{dx} \log x = \frac{1}{x} \end{align*}

    • If \(x\lt 0\) then \(|x|= -x\text{.}\) If \(|h|\) is strictly smaller than \(|x|\text{,}\) then we also have that \(x+h\lt 0\) and \(|x+h|=-(x+h)=|x|-h\text{.}\) Write \(X=|x|\) and \(H=-h\text{.}\) Then, by the definition of the derivative,

      \begin{align*} g'(x) &= \lim_{h\rightarrow 0} \frac{\log|x+h|-\log|x|}{h} = \lim_{h\rightarrow 0} \frac{\log(|x|-h)-\log|x|}{h} \\ &= \lim_{H\rightarrow 0} \frac{\log(X+H)-\log X}{-H} = -\lim_{H\rightarrow 0} \frac{\log(X+H)-\log X}{H} \\ &=-\dfrac{d}{dX}\log X =-\frac{1}{X} = -\frac{1}{|x|} \\ &=\frac{1}{x} \end{align*}

    • Since \(\log 0\) is undefined, \(g'(0)\) does not exist.

    Putting this together gives:

    \begin{align*} \dfrac{d}{dx} \log | x | &= \frac{1}{x} \end{align*}

    Example 2.10.5 The derivative of \(x^a\).

    Just after Corollary 2.6.17, we said that we would, in the future, find the derivative of \(x^a\) for all real numbers. The future is here. Let \(x\gt 0\) and \(a\) be any real number. Exponentiating both sides of \(\log\big(x^a\big)=a\log x\) gives us \(x^a=e^{a\log x}\) and then

    \begin{align*} \dfrac{d}{dx} x^a &= \dfrac{d}{dx} e^{a\log x} = e^{a\log x} \dfrac{d}{dx}(a\log x) &\text{by the chain rule} \\ &=\frac{a}{x} e^{a\log x} =\frac{a}{x} x^a \\ &=a x^{a-1} \end{align*}

    as expected.

    We can extend Theorem 2.10.1 to compute the derivative of logarithms of other bases in a straightforward way. Since for any positive \(a \neq 1\text{:}\)

    \begin{align*} \log_a x &= \frac{\log x}{\log a} = \frac{1}{\log a} \cdot \log x & \text{since $a$ is a constant}\\ \dfrac{d}{dx} \log_a x &= \frac{1}{\log a} \cdot \frac{1}{x} \end{align*}

    Back to \(\mathbf{\dfrac{d}{dx} a^x}\)

    We can also now finally get around to computing the derivative of \(a^x\) (which we started to do back in Section 2.7).

    \begin{align*} f(x) &= a^x & \text{take log of both sides}\\ \log f(x) &= x \log a & \text{exponentiate both sides base $e$}\\ f(x) &= e^{x \log a} & \text{chain rule}\\ f'(x) &= e^{x \log a} \cdot \log a\\ &= a^x \cdot \log a \end{align*}

    Notice that we could have also done the following:

    \begin{align*} f(x) &= a^x & \text{take log of both sides}\\ \log f(x) &= x \log a & \text{differentiate both sides}\\ \dfrac{d}{dx} \left( \log f(x) \right) &= \log a\\ \end{align*}

    We then process the left-hand side using the chain rule

    \begin{align*} f'(x) \cdot \frac{1}{f(x)} &= \log a\\ f'(x) &= f(x) \cdot \log a = a^x \cdot \log a \end{align*}

    We will see \(\dfrac{d}{dx} \log f(x)\) more below in the subsection on “logarithmic differentiation”.

    To summarise the results above:

    Corollary 2.10.6.

    \begin{align*} \dfrac{d}{dx} a^x &= \log a \cdot a^x & \text{for any $a \gt 0$}\\ \dfrac{d}{dx} \log_a x &= \frac{1}{x \cdot \log a} & \text{for any $a \gt 0, a \neq 1$} \end{align*}

    where \(\log x\) is the natural logarithm.

    Recall that we need the caveat \(a \neq 1\) because the logarithm base 1 is not well defined. This is because \(1^x = 1\) for any \(x\text{.}\) We do not need a similar caveat for the derivative of the exponential because we know (recall Example 2.7.1)

    \begin{align*} \dfrac{d}{dx} 1^x &= \dfrac{d}{dx} 1= 0 &\text{while the above corollary tells us}\\ &= \log 1 \cdot 1^x = 0 \cdot 1 = 0. \end{align*}

    Logarithmic Differentiation

    We want to go back to some previous slightly messy examples (Examples 2.6.6 and 2.6.18) and now show you how they can be done more easily.

    Example 2.10.7 Derivative of a triple product.

    Consider again the derivative of the product of 3 functions:

    \begin{align*} P(x) &= F(x) \cdot G(x) \cdot H(x) \end{align*}

    Start by taking the logarithm of both sides:

    \begin{align*} \log P(x) &= \log \left( F(x) \cdot G(x) \cdot H(x) \right)\\ &= \log F(x) + \log G(x) + \log H(x)\\ \end{align*}

    Notice that the product of functions on the right-hand side has become a sum of functions. Differentiating sums is much easier than differentiating products. So when we differentiate we have

    \begin{align*} \dfrac{d}{dx}\log P(x) &= \dfrac{d}{dx}\log F(x) + \dfrac{d}{dx}\log G(x) + \dfrac{d}{dx}\log H(x)\\ \end{align*}

    A quick application of the chain rule shows that \(\dfrac{d}{dx}\log f(x) = f'(x) / f(x)\text{:}\)

    \begin{align*} \frac{P'(x)}{P(x)} &= \frac{F'(x)}{F(x)}+\frac{G'(x)}{G(x)}+\frac{H'(x)}{H(x)}\\ \end{align*}

    Multiply through by \(P(x)=F(x)G(x)H(x)\text{:}\)

    \begin{align*} P'(x) &= \left(\frac{F'(x)}{F(x)}+\frac{G'(x)}{G(x)}+\frac{H'(x)}{H(x)}\right)\cdot F(x)G(x)H(x)\\ &= F'(x)G(x)H(x) + F(x)G'(x)H(x) + F(x)G(x)H'(x) \end{align*}

    which is what found in Example 2.6.6 by repeated application of the product rule. The above generalises quite easily to more than 3 functions.

    This same trick of “take a logarithm and then differentiate” — or logarithmic differentiation — will work any time you have a product (or ratio) of functions.

    Example 2.10.8 Derivative of a messy product.

    Lets use logarithmic differentiation on the function from Example 2.6.18:

    \begin{align*} f(x) &=\frac{(\sqrt{x}-1)(2-x)(1-x^2)}{\sqrt{x}(3+2x)} \end{align*}

    Beware however, that we may only take the logarithm of positive numbers, and this \(f(x)\) is often negative. For example, if \(1 \lt x \lt 2 \text{,}\) the factor \((1-x^2)\) in the definition of \(f(x)\) is negative while all of the other factors are positive, so that \(f(x)\lt 0 \text{.}\) None–the–less, we can use logarithmic differentiation to find \(f'(x)\text{,}\) by exploiting the observation that \(\dfrac{d}{dx}\log|f(x)|=\frac{f'(x)}{f(x)}\text{.}\) (To see this, use the chain rule and Example 2.10.4.) So we take the logarithm of \(|f(x)|\) and expand.

    \begin{align*} \log |f(x)| & = \log \frac{|\sqrt{x}-1|\,|2-x|\,|1-x^2|}{\sqrt{x}|3+2x|}\\ & = \log|\sqrt{x}\!-\!1| + \log|2\!-\!x| + \log|1\!-\!x^2| - \underbrace{\log(\sqrt{x})}_{=\frac{1}{2}\log x} - \log|3\!+\!2x| \end{align*}

    Now we can essentially just differentiate term-by-term:

    \begin{align*} \dfrac{d}{dx}\log |f(x)| &= \dfrac{d}{dx} \Big( \log|\sqrt{x}-1| + \log|2-x| + \log|1-x^2| \\ &\hskip2in- \frac{1}{2}\log|x| - \log|3+2x| \Big)\\ \frac{f'(x)}{f(x)} &= \frac{1/(2\sqrt{x})}{\sqrt{x}-1} + \frac{-1}{2-x} + \frac{-2x}{1-x^2} - \frac{1}{2x} - \frac{2}{3+2x}\\ f'(x) &= f(x) \cdot \left( \frac{1}{2 \sqrt{x} (\sqrt{x}\!-\!1)} - \frac{1}{2\!-\!x} - \frac{2x}{1\!-\!x^2} - \frac{1}{2x} - \frac{2}{3\!+\!2x} \right)\\ &= \frac{(\sqrt{x}-1)(2-x)(1-x^2)}{\sqrt{x}(3+2x)} \cdot \\ &\hskip0.5in\left( \frac{1}{2 \sqrt{x} (\sqrt{x}-1)} - \frac{1}{2-x} - \frac{2x}{1-x^2} - \frac{1}{2x} - \frac{2}{3+2x} \right) \end{align*}

    just as we found previously.


    Reminder: in these notes, we use \(\log x\) to mean \(\log_e x\text{,}\) which is also commonly written elsewhere as \(\ln x\text{.}\)

    Stage 1
    Exercise \(\PageIndex{1}\)

    The volume in decibels (dB) of a sound is given by the formula:

    \[ V(P)=10\log_{10}\left(\frac{P}{S}\right) \nonumber \]

    where \(P\) is the intensity of the sound and \(S\) is the intensity of a standard baseline sound. (That is: \(S\) is some constant.)

    How much noise will ten speakers make, if each speaker produces 3dB of noise? What about one hundred speakers?

    Exercise \(\PageIndex{2}\)

    An investment of $1000 with an interest rate of 5% per year grows to

    \[ A(t)=1000e^{t/20} \nonumber \]

    dollars after \(t\) years. When will the investment double?

    Exercise \(\PageIndex{3}\)

    Which of the following expressions, if any, is equivalent to \(\log\left(\cos^2 x\right)\text{?}\)

    \begin{align*} &(\mbox{a})\quad 2\log(\cos x)& &(\mbox{b})\quad 2\log|\cos x |& &(\mbox{c})\quad \log^2(\cos x) \\ &(\mbox{d})\quad \log(\cos x^2)) \end{align*}

    Stage 2
    Exercise \(\PageIndex{4}\)

    Differentiate \(f(x)=\log(10x)\text{.}\)

    Exercise \(\PageIndex{5}\)

    Differentiate \(f(x)=\log(x^2)\text{.}\)

    Exercise \(\PageIndex{6}\)

    Differentiate \(f(x)=\log(x^2+x)\text{.}\)

    Exercise \(\PageIndex{7}\)

    Differentiate \(f(x)=\log_{10}x\text{.}\)

    Exercise \(\PageIndex{8}\)(✳)

    Find the derivative of \(y=\dfrac{\log x}{x^3}\text{.}\)

    Exercise \(\PageIndex{9}\)

    Evaluate \(\displaystyle \dfrac{d}{d\theta} \log(\sec \theta)\text{.}\)

    Exercise \(\PageIndex{10}\)

    Differentiate the function \(f(x)=e^{\cos\left(\log x\right)}\text{.}\)

    Exercise \(\PageIndex{11}\) (✳)

    Evaluate the derivative. You do not need to simplify your answer.

    \[ y=\log(x^2+\sqrt{x^4+1}) \nonumber \]

    Exercise \(\PageIndex{12}\) (✳)

    Differentiate \(\sqrt{-\log(\cos x)}\text{.}\)

    Exercise \(\PageIndex{13}\) (✳)

    Calculate and simplify the derivative of \(\log\big(x+\sqrt{x^2+4}\big)\text{.}\)

    Exercise \(\PageIndex{14}\) (✳)

    Evaluate the derivative of \(g(x)=\log (e^{x^2}+\sqrt{1+x^4})\text{.}\)

    Exercise \(\PageIndex{15}\) (✳)

    Evaluate the derivative of the following function at \(x=1\text{:}\) \(g(x)=\log\Big(\dfrac{2x-1}{2x+1}\Big)\text{.}\)

    Exercise \(\PageIndex{16}\)

    Evaluate the derivative of the function \(f(x) = \log\left(\sqrt{\dfrac{(x^2+5)^3}{x^4+10}}\right)\text{.}\)

    Exercise \(\PageIndex{17}\)

    Evaluate \(f'(2)\) if \(f(x) = \log\big(g\big(xh(x)\big)\big)\text{,}\) \(h(2) = 2\text{,}\) \(h'(2) = 3\text{,}\) \(g(4) = 3\text{,}\) \(g'(4) = 5\text{.}\)

    Exercise \(\PageIndex{18}\) (✳)

    Differentiate the function

    \[ g(x)=\pi^x+x^\pi. \nonumber \]

    Exercise \(\PageIndex{19}\)

    Differentiate \(f(x)=x^x\text{.}\)

    Exercise \(\PageIndex{20}\) (✳)

    Find \(f'(x)\) if \(f(x) = x^x+\log_{10}x\text{.}\)

    Exercise \(\PageIndex{21}\)

    Differentiate \(f(x) = \sqrt[4]{\dfrac{(x^4+12)(x^4-x^2+2)}{x^3}}\text{.}\)

    Exercise \(\PageIndex{22}\)

    Differentiate \(f(x)=(x+1)(x^2+1)^2(x^3+1)^3(x^4+1)^4(x^5+1)^5\text{.}\)

    Exercise \(\PageIndex{23}\)

    Differentiate \(f(x) = \left(\dfrac{5x^2+10x+15}{3x^4+4x^3+5}\right)\left(\dfrac{1}{10(x+1)}\right)\text{.}\)

    Exercise \(\PageIndex{24}\) (✳)

    Let \(f(x) = (\cos x)^{\sin x}\text{,}\) with domain \(0 \lt x \lt \tfrac{\pi}{2}\text{.}\) Find \(f'(x)\text{.}\)

    Exercise \(\PageIndex{25}\) (✳)

    Find the derivative of \((\tan(x))^x\text{,}\) when \(x\) is in the interval \((0,\pi/2)\text{.}\)

    Exercise \(\PageIndex{26}\) (✳)

    Find \(f'(x)\) if \(f(x)= (x^2+1)^{(x^2+1)}\)

    Exercise \(\PageIndex{27}\) (✳)

    Differentiate \(f(x)= (x^2+1)^{\sin(x)}\text{.}\)

    Exercise \(\PageIndex{28}\) (✳)

    Let \(f(x)= x^{\cos^3(x)}\text{,}\) with domain \((0,\infty)\text{.}\) Find \(f'(x)\text{.}\)

    Exercise \(\PageIndex{29}\) (✳)

    Differentiate \(f(x)= (3+\sin(x))^{x^2-3}\text{.}\)

    Stage 3
    Exercise \(\PageIndex{30}\)

    Let \(f(x)\) and \(g(x)\) be differentiable functions, with \(f(x) \gt 0\text{.}\) Evaluate \(\displaystyle \dfrac{d}{dx}\left\{[f(x)]^{g(x)}\right\}\text{.}\)

    Exercise \(\PageIndex{31}\)

    Let \(f(x)\) be a function whose range includes only positive numbers. Show that the curves \(y=f(x)\) and \(y=\log(f(x))\) have horizontal tangent lines at the same values of \(x\text{.}\)

    This page titled 2.10: The Natural Logarithm is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Joel Feldman, Andrew Rechnitzer and Elyse Yeager via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.