Skip to content

The derivative of a logarithmic function

The derivative of a logarithmic function

The derivative of ln⁡x\displaystyle \ln x from the inverse function

ln⁡x\displaystyle \ln x is the inverse function of ex\displaystyle e^x, so its graph is the reflection of the graph of ex\displaystyle e^x in the line y=x\displaystyle {y}={x}. The tangents are reflected too:

  • The point A(1,e)\displaystyle A(1,e) is on the graph of ex\displaystyle e^x, and the slope there is e1=e\displaystyle {e^1}={e}.
  • Reflected, it goes to the point B(e,1)\displaystyle B(e,1) on the graph of ln⁡x\displaystyle \ln x, and the tangent y=ex\displaystyle {y}={ex} goes to the tangent y=xe\displaystyle {y}={\frac{x}{e}}.
  • The reflection swaps the change in x\displaystyle x and the change in y\displaystyle y, so the slope m\displaystyle m becomes 1m\displaystyle \frac{1}{m}: the slope at B\displaystyle B is 1e\displaystyle \frac{1}{e}.
f(x)=ex\displaystyle f(x)=e^{x}
g(x)=ln⁡x\displaystyle g(x)=\ln x
y=x\displaystyle y=x
y=ex\displaystyle y=ex
y=xe\displaystyle y=\frac{x}{e}
A=(1,2.718)\displaystyle A=(1,2.718)
B=(2.718,1)\displaystyle B=(2.718,1)

So at every point: at the point (t,et)\displaystyle (t,e^t) on the graph of ex\displaystyle e^x the slope is et\displaystyle e^t, and at the point (et,t)\displaystyle (e^t,t) on the graph of ln⁡x\displaystyle \ln x the slope is 1et\displaystyle \frac{1}{e^t}. At that point x=et\displaystyle {x}={e^t}, so the slope is 1x\displaystyle \frac{1}{x}:

(ln⁡x)′\displaystyle (\ln x)' =\displaystyle = 1x\displaystyle \frac{1}{x}
  • The derivative is defined in the domain of ln⁡x\displaystyle \ln x, that is where x>0\displaystyle x>0.
  • 1x>0\displaystyle \frac{1}{x}>0: the function ln⁡x\displaystyle \ln x increases throughout its domain.
  • (ln⁡x)′′=−1x2<0\displaystyle {(\ln x)''}={-\frac{1}{x^2}<0}: the graph is concave down throughout the domain.
The derivative of ln⁡f(x)\displaystyle \ln f(x)

ln⁡f(x)\displaystyle \ln f(x) is a composite function: the outer derivative 1f(x)\displaystyle \frac{1}{f(x)} times the inner derivative f′(x)\displaystyle f'(x).

[ln⁡(f(x))]′\displaystyle \left[\ln(f(x))\right]' =\displaystyle = f′(x)f(x)\displaystyle \frac{f'(x)}{f(x)}
  • (ln⁡(x2+1))′=2xx2+1\displaystyle {\left(\ln(x^2+1)\right)'}={\frac{2x}{x^2+1}}.
  • (ln⁡(3x−2))′=33x−2\displaystyle {\left(\ln(3x-2)\right)'}={\frac{3}{3x-2}}, in the domain x>23\displaystyle x>\frac{2}{3}.
  • (ln⁡(5x))′=55x=1x\displaystyle {\left(\ln(5x)\right)'}={\frac{5}{5x}}={\frac{1}{x}}: by the laws too, ln⁡(5x)=ln⁡5+ln⁡x\displaystyle {\ln(5x)}={\ln5+\ln x}, and the derivative of the constant ln⁡5\displaystyle \ln5 is 0.
The derivative of log⁡ax\displaystyle \log_a x

By the change of base, log⁡ax=ln⁡xln⁡a\displaystyle {\log_a x}={\frac{\ln x}{\ln a}}, and ln⁡a\displaystyle \ln a is a constant:

(log⁡ax)′\displaystyle (\log_{a}x)' =\displaystyle = 1xln⁡a\displaystyle \frac{1}{x\ln a}
  • (log⁡2x)′=1xln⁡2\displaystyle {(\log_2 x)'}={\frac{1}{x\ln2}}.
  • (log⁡x)′=1xln⁡10\displaystyle {(\log x)'}={\frac{1}{x\ln10}}.
The derivative of ln⁡(−x)\displaystyle \ln(-x)

ln⁡(−x)\displaystyle \ln(-x) is defined where −x>0\displaystyle -x>0, that is where x<0\displaystyle x<0. Its graph is the reflection of the graph of ln⁡x\displaystyle \ln x in the y-axis.

  • By the derivative of ln⁡f(x)\displaystyle \ln f(x): (ln⁡(−x))′=−1−x=1x\displaystyle {\left(\ln(-x)\right)'}={\frac{-1}{-x}}={\frac{1}{x}}.
  • ln⁡x\displaystyle \ln x and ln⁡(−x)\displaystyle \ln(-x) have the same derivative, 1x\displaystyle \frac{1}{x}, each in its own domain.
  • Where x<0\displaystyle x<0, 1x<0\displaystyle \frac{1}{x}<0: ln⁡(−x)\displaystyle \ln(-x) decreases.
f(x)=ln⁡x\displaystyle f(x)=\ln x
g(x)=ln⁡(−x)\displaystyle g(x)=\ln(-x)
Simplifying by the laws of logarithms before differentiating

Sometimes it pays to break up a logarithm by the laws of logarithms before differentiating. The example below differentiates f(x)=ln⁡x2x+1\displaystyle {f(x)}={\ln\frac{x^2}{x+1}}, where x>0\displaystyle x>0:

  • f(x)=ln⁡x2−ln⁡(x+1)=2ln⁡x−ln⁡(x+1)\displaystyle {f(x)}={\ln x^2-\ln(x+1)}={2\ln x-\ln(x+1)}.
  • f′(x)=2x−1x+1\displaystyle {f'(x)}={\frac{2}{x}-\frac{1}{x+1}}.
  • Over a common denominator: f′(x)=2(x+1)−xx(x+1)=x+2x(x+1)\displaystyle {f'(x)}={\frac{2(x+1)-x}{x(x+1)}}={\frac{x+2}{x(x+1)}}.
A tangent to the graph of a logarithm

The example below finds the equation of the tangent to the graph of f(x)=ln⁡(2x−1)\displaystyle {f(x)}={\ln(2x-1)} at the point where x=1\displaystyle {x}={1}:

  • The point of contact: f(1)=ln⁡1=0\displaystyle {f(1)}={\ln1}={0}, that is (1,0)\displaystyle (1,0).
  • The slope: f′(x)=22x−1\displaystyle {f'(x)}={\frac{2}{2x-1}}, so f′(1)=2\displaystyle {f'(1)}={2}.
  • The tangent: y−0=2(x−1)\displaystyle {y-0}={2(x-1)}, that is y=2x−2\displaystyle {y}={2x-2}.
Exercise 1

Differentiate.

a

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

    b

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

      c

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

        d

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

          Exercise 2

          The function f(x)=ln⁡x+1x\displaystyle {f(x)}={\ln x+\frac{1}{x}} is given, in the domain x>0\displaystyle x>0.

          a

          Find f′(x)\displaystyle f'(x), and write it as one fraction.

          f(x)=ln⁡x+1x\displaystyle f(x)=\ln x+\frac{1}{x}

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

            b

            Solve the equation f′(x)=0\displaystyle {f'(x)}={0}.

              c

              Find the second derivative f′′(x)\displaystyle f''(x), and write it as one fraction.

              f(x)=ln⁡x+1x\displaystyle f(x)=\ln x+\frac{1}{x}

                / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

                / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

                d

                Find where the graph is concave up: solve the inequality f′′(x)>0\displaystyle f''(x)>0.

                  e

                  Mark the extremum point and the inflection point on the graph.

                  f(x)=ln⁡x+1x\displaystyle f(x)=\ln x+\frac{1}{x}
                  x=0\displaystyle x=0

                  Exercise 3

                  The function f(x)=ln⁡(4−x2)\displaystyle {f(x)}={\ln(4-x^2)} is given.

                  a

                  Find the domain of the function: solve the inequality.

                    b

                    Find f′(x)\displaystyle f'(x).

                    f(x)=ln⁡(4−x2)\displaystyle f(x)=\ln(4-x^{2})

                      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

                      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

                      c

                      Solve the equation f′(x)=0\displaystyle {f'(x)}={0}.

                        d

                        Mark on the graph the extremum point and the points where it meets the x-axis.

                        f(x)=ln⁡(4−x2)\displaystyle f(x)=\ln(4-x^{2})
                        x=−2\displaystyle x=-2
                        x=2\displaystyle x=2

                        Exercise 4

                        A tangent to the graph of f(x)=ln⁡x\displaystyle {f(x)}={\ln x} at the point (a,ln⁡a)\displaystyle (a,\ln a) passes through the origin.
                        The equation of the tangent is y−ln⁡a=1a(x−a)\displaystyle {y-\ln a}={\frac{1}{a}(x-a)}.

                        a

                        Putting the point (0,0)\displaystyle (0,0) into the equation of the tangent gives −ln⁡a=−1\displaystyle {-\ln a}={-1}, that is ln⁡a=1\displaystyle {\ln a}={1}.
                        Solve the equation (written with x\displaystyle x in place of a\displaystyle a).

                          b

                          Write the equation of the tangent.

                          f(x)=ln⁡x\displaystyle f(x)=\ln x