NZ Level 8 (NZC) Level 3 (NCEA) [In development]
topic badge
Basic derivative of Logs

The derivative of a natural log function

Recall from our work on the calculus of exponential functions that if $y=e^x$y=ex then $\frac{dy}{dx}=e^x$dydx=ex.

From the definition of $y=\log_ex$y=logex we know that $x=e^y$x=ey, and so, following the pattern above, we can conclude that $\frac{dx}{dy}=e^y$dxdy=ey

Inverting the elements in this equation we can then say that $\frac{dy}{dx}=\frac{1}{e^y}$dydx=1ey, but since $x=e^y$x=ey, we conclude that $\frac{dy}{dx}=\frac{1}{x}$dydx=1x.

We can write our result using the natural logarithm notation as:

$\frac{d}{dx}\left(\ln x\right)=\frac{1}{x}$ddx(lnx)=1x 


Gradient of the tangent

This is a fascinating result. The gradient of the tangent at the point $x=a$x=a to the curve given by $y=\ln x$y=lnx  is simply $\frac{1}{a}$1a

Have a play with this applet and see for yourself.

At $x=1$x=1 for example, $\frac{dy}{dx}=\frac{1}{1}=1$dydx=11=1. At $x=2$x=2$\frac{dy}{dx}=\frac{1}{2}$dydx=12. At $x=3$x=3$\frac{dy}{dx}=\frac{1}{3}$dydx=13 and so on. As $x$x becomes larger and larger the tangents gradient diminishes, but always remaining positive as it does so. The gradient at $x=1000$x=1000 for example is $\frac{dy}{dx}=0.001$dydx=0.001

If we think about the shape of the log curve, the gradients make sense. As $x$x becomes smaller and smaller within the interval $00<x<1 the gradient becomes larger and larger. We can graph the derivative as a function itself along side the curve $y=\ln x$y=lnx, shown here:

The point highlighted at $x=1$x=1 shows a tangent of gradient $m=1$m=1 crossing the x axis at $45^{\circ}$45  as expected.


Working with derivatives

Before we look at a few examples, we need to establish three important results:

Result 1: other bases

From the change of base rule we know that the function $y=\log_bx$y=logbx can be rearranged as follows:

$y$y $=$= $\log_bx$logbx
  $=$= $\frac{\log_ex}{\log_eb}$logexlogeb
  $=$= $\frac{\ln x}{\ln b}$lnxlnb
  $=$= $\left(\frac{1}{\ln b}\right)\ln x$(1lnb)lnx
$\therefore y$y $=$= $k\times\ln x$k×lnx

Hence, we know that if $y=\log_bx$y=logbx, then$\frac{dy}{dx}=\frac{k}{x}=\frac{1}{x\ln b}$dydx=kx=1xlnb.

For example, if $y=\log_{10}x$y=log10x, then $\frac{dy}{dx}=\frac{1}{x\ln10}$dydx=1xln10


Result 2: The function of a function rule

Consider the function $y=\ln\left(2x-5\right)$y=ln(2x5). By putting $u=2x-5$u=2x5 we can write the function as $y=\ln u$y=lnu. Then $\frac{dy}{du}=\frac{1}{u}and\frac{du}{dx}=2$dydu=1uanddudx=2, and so;


In general, if $y=\ln u$y=lnu, where $u$u is some function of $x$x, then $\frac{dy}{dx}=\frac{u'}{u}$dydx=uu.


Result 3: The absolute value sign

It is often the case that the argument of the given log function includes the absolute value sign. For example the function $y=\ln(\left|2x-9\right|)$y=ln(|2x9|), with the argument $\left|2x-9\right|$|2x9|, is defined for all $x\ne4.5$x4.5.

The absolute value arises whenever an integration leads to a log function. For example, when integrating the function $y=\frac{1}{x}$y=1x, we should formally write that  $\int\frac{1}{x}dx=\ln\left|x\right|+C$1xdx=ln|x|+C. In some texts however, the absolute value signs are omitted, and the integral solution is simply shown as $\ln x+C$lnx+C

This will be discussed more fully later on, but it is important to remain vigilant about the inferred domain of the log function given. 



Example 1


For $y=\ln\left(\left|3x+7\right|\right)$y=ln(|3x+7|), we have $\frac{dy}{dx}=\frac{3}{3x+7}$dydx=33x+7.

We might ask what happened to the absolute value sign in the solution?

According to the definition of absolute value, the function $y=\ln\left(\left|3x+7\right|\right)$y=ln(|3x+7|) can be split up into two parts as follows: 

For $x\ge-\frac{7}{3}$x73, the function becomes $y=\ln\left(3x+7\right)$y=ln(3x+7) and the derivative is simply given by $\frac{dy}{dx}=\frac{3}{3x+7}$dydx=33x+7 within that interval.

For $x<-\frac{7}{3}$x<73, the function becomes $y=\ln\left(-3x-7\right)$y=ln(3x7) and the derivative becomes $\frac{dy}{dx}=\frac{-3}{-3x-7}=\frac{3}{3x+7}$dydx=33x7=33x+7

In both intervals, the solution is exactly the same, and this is why the absolute value sign can be omitted.

Example 2


First note that the argument of the log function implies that $x<1$x<1. The derivative is given by $\frac{dy}{dx}=2\left(\frac{-1}{1-x}\right)=\frac{-2}{1-x}=\frac{2}{x-1}$dydx=2(11x)=21x=2x1

Even though a function like $y=\frac{2}{x-1}$y=2x1 is defined for all $x\ne1$x1, the domain of the log function restricts the derivative to the interval $x<1$x<1. This is an important point to consider when interpreting the derivative. The derivative cannot exist outside the natural domain of the function. 

Example 3

Find the gradient of the tangent to the curve $y=\ln\left(4x-8\right)$y=ln(4x8) at the point where $x=3$x=3.

For $y=\ln\left(4x-8\right)$y=ln(4x8), we have $\frac{dy}{dx}=\frac{4}{4x-8}=\frac{1}{x-2}$dydx=44x8=1x2. So at $x=3$x=3$\frac{dy}{dx}=1$dydx=1. The gradient of the tangent is thus $1$1.  


Example 4

$y=\ln e^{2x+1}$y=lne2x+1

We should note here that the function can be simplified to $y=2x+1$y=2x+1, and so $\frac{dy}{dx}=2$dydx=2.

Example 5

In this question, we will be calculating the gradient of the tangent line to the curve $y=\ln\left(\left|3x-7\right|\right)$y=ln(|3x7|) at $x=0$x=0.

  1. First, find $\frac{dy}{dx}$dydx.

  2. Now find the value of $\frac{dy}{dx}$dydx at $x=0$x=0 to find the gradient of the tangent line.

Example 6

Find the derivative of $y=3\ln\left(\left|5x-2\right|\right)$y=3ln(|5x2|).

Example 7

Find the derivative of $y=\ln e^{8x}$y=lne8x.




Choose and apply a variety of differentiation, integration, and antidifferentiation techniques to functions and relations, using both analytical and numerical methods


Apply differentiation methods in solving problems

What is Mathspace

About Mathspace