iGCSE (2021 Edition)

# 11.15 Differentiating logarithmic functions

Lesson

Recall that we differentiate the exponential function as follows:

Differentiating the exponential function
 $\frac{d}{dx}e^x$ddx​ex $=$= $e^x$ex

We will now use this result to determine how to differentiate the inverse function $y=\ln x$y=lnx.

### Differentiating $y=\ln x$y=lnx

In order to find the derivative of $y=\ln x$y=lnx, we want to make use of our knowledge of differentiating exponential functions. To do so, let's first rewrite the equation in exponential form:

 $y$y $=$= $\ln x$lnx $e^y$ey $=$= $e^{\ln x}$elnx $x$x $=$= $e^y$ey

We can now use our rule for differentiating exponential functions by differentiating $x=e^y$x=ey with respect to $y$y:

 $\frac{dx}{dy}$dxdy​ $=$= $e^y$ey

As $y=e^x$y=ex and $x=e^y$x=ey are inverse functions we can say that:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{\frac{dx}{dy}}$1dxdy​​

And so we have that:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{e^y}$1ey​

Now we can rewrite the derivative back in terms of $x$x by remembering that $x=e^y$x=ey. Thus we have:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{x}$1x​

Therefore for $y=\ln x$y=lnx:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{x}$1x​

Standard form for differentiating natural logarithmic functions
 $\frac{d}{dx}\ln x$ddx​lnx $=$= $\frac{1}{x}$1x​ for $x>0$x>0

Note that $y=\ln x$y=lnx is only defined for $x>0$x>0. As such, the derivative is also only defined over this domain.

### Differentiating $y=\ln\left(f\left(x\right)\right)$y=ln(f(x))

Consider functions of the form:

 $y$y $=$= $\ln\left(f\left(x\right)\right)$ln(f(x))

Letting $u=f\left(x\right)$u=f(x), we have:

 $y$y $=$= $\ln u$lnu $\frac{dy}{du}$dydu​ $=$= $\frac{1}{u}$1u​ $\frac{du}{dx}$dudx​ $=$= $f'\left(x\right)$f′(x)

Using the chain rule:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{dy}{du}\times\frac{du}{dx}$dydu​×dudx​ $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{u}\times u'$1u​×u′ $\frac{dy}{dx}$dydx​ $=$= $\frac{f'\left(x\right)}{f\left(x\right)}$f′(x)f(x)​

Differentiating $y=\ln\left(f\left(x\right)\right)$y=ln(f(x))
 $\frac{d}{dx}\ln\left(f\left(x\right)\right)$ddx​ln(f(x)) $=$= $\frac{f'\left(x\right)}{f\left(x\right)}$f′(x)f(x)​ for $f\left(x\right)>0$f(x)>0

#### Worked example

##### Example 1

Differentiate the function $y=\ln\left(2x^3-x+1\right)$y=ln(2x3x+1).

Think: This is a function in the form $y=\ln\left(f\left(x\right)\right)$y=ln(f(x)). Hence, to find $y'$y, we take the derivative of $f\left(x\right)$f(x) and divide it by $f\left(x\right)$f(x).

Do: In this case, $f\left(x\right)=2x^3-x+1$f(x)=2x3x+1. So we obtain the derivative of $y$y as follows:

 $y$y $=$= $\ln\left(2x^3-x+1\right)$ln(2x3−x+1) $\frac{dy}{dx}$dydx​ $=$= $\frac{6x^2-1}{2x^3-x+1}$6x2−12x3−x+1​

#### Practice question

##### Question 1

Find the derivative of $y=\ln\left(x^4+2\right)$y=ln(x4+2). You may use the substitution $u=x^4+2$u=x4+2.

### Differentiating harder logarithmic functions

When faced with finding the derivative of a more complicated logarithmic function, we can often utilise the logarithmic laws and product and quotient rules to help make the process more manageable.

Remember

$\log_bx+\log_by=\log_b\left(xy\right)$logbx+logby=logb(xy)

$\log_bx-\log_by=\log_b\left(\frac{x}{y}\right)$logbxlogby=logb(xy)

$\log_b\left(x^n\right)=n\log_bx$logb(xn)=nlogbx

#### Worked examples

##### Example 2

Find the first derivative of $y=\ln\left(\left(\frac{x+1}{x-1}\right)^2\right)$y=ln((x+1x1)2)

Think: Using the power law and subtraction law for logs to rewrite the function:

 $y$y $=$= $2\ln\left(\frac{x+1}{x-1}\right)$2ln(x+1x−1​) $y$y $=$= $2\left(\ln\left(x+1\right)-\ln\left(x-1\right)\right)$2(ln(x+1)−ln(x−1))

Do: This gives us an easier function to differentiate:

 $\frac{dy}{dx}$dydx​ $=$= $2\left(\frac{1}{x+1}-\frac{1}{x-1}\right)$2(1x+1​−1x−1​) $\frac{dy}{dx}$dydx​ $=$= $\frac{-4}{x^2-1}$−4x2−1​
##### Example 3

Differentiate $y=\ln\left(\frac{1}{\left(x+1\right)^3}\right)$y=ln(1(x+1)3)

Think: We can use the power log law to make the function easier to differentiate:

 $y$y $=$= $\ln\left(x+1\right)^{-3}$ln(x+1)−3 $y$y $=$= $-3\ln\left(x+1\right)$−3ln(x+1)

Do: This gives us an easier function to differentiate:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{-3}{x+1}$−3x+1​

#### Practice questions

##### Question 2

Consider the function $f\left(x\right)=\ln\left(\sqrt{x^2+1}\right)$f(x)=ln(x2+1).

1. Find $f'\left(x\right)$f(x).

2. Hence find $f'\left(2\right)$f(2).

##### Question 3

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

### Differentiating $y=\log_ax$y=loga​x

Functions in the form $y=\log_ax$y=logax, where the logarithm has a base other than $e$e, cannot be differentiated directly. We will first need to make use of the change of base rule for logarithms to rewrite such functions using the natural logarithm.

Change of base rule for logarithms

$\log_ab=\frac{\log_cb}{\log_ca}$logab=logcblogca

Let's use this change of base rule to rewrite the function $y=\log_ax$y=logax in terms of the natural logarithm:

 $y$y $=$= $\log_ax$loga​x $y$y $=$= $\frac{\log_ex}{\log_ea}$loge​xloge​a​ $y$y $=$= $\frac{\ln x}{\ln a}$lnxlna​ $y$y $=$= $\left(\frac{1}{\ln a}\right)\ln x$(1lna​)lnx

The expression $\frac{1}{\ln a}$1lna is a constant, which means we can now differentiate the function using the fact that the derivative of $\ln x$lnx is $\frac{1}{x}$1x:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{\ln a}\times\frac{1}{x}$1lna​×1x​ $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{x\ln a}$1xlna​

#### Worked example

##### Example 4

Find the first derivative of $y=\log_{10}x$y=log10x

Think: Changing the base we get:

 $y$y $=$= $\frac{\ln x}{\ln10}$lnxln10​

Do: Differentiating:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{x\ln10}$1xln10​

#### Practice question

##### Question 4

Differentiate $y=\log_2x$y=log2x.

### Differentiating $y=\log_a\left(f\left(x\right)\right)$y=loga​(f(x))

We can use the same process shown above to differentiate more general logarithms of bases other than $e$e - that is, functions in the form $y=\log_a\left(f\left(x\right)\right)$y=loga(f(x)).

Once again, we make use of the change of base rule to rewrite our function in terms of the natural logarithm:

 $y$y $=$= $\log_a\left(f\left(x\right)\right)$loga​(f(x)) $y$y $=$= $\frac{\log_e\left(f\left(x\right)\right)}{\log_ea}$loge​(f(x))loge​a​ $y$y $=$= $\frac{\ln\left(f\left(x\right)\right)}{\ln a}$ln(f(x))lna​ $y$y $=$= $\left(\frac{1}{\ln a}\right)\ln\left(f\left(x\right)\right)$(1lna​)ln(f(x))

The expression $\frac{1}{\ln a}$1lna is a constant, and we already know that the derivative of $\ln\left(f\left(x\right)\right)$ln(f(x)) is $\frac{f'\left(x\right)}{f\left(x\right)}$f(x)f(x). Putting this together, we have:

 $\frac{dy}{dx}$dydx​ $=$= $\frac{1}{\ln a}\times\frac{f'\left(x\right)}{f\left(x\right)}$1lna​×f′(x)f(x)​ $\frac{dy}{dx}$dydx​ $=$= $\frac{f'\left(x\right)}{f\left(x\right)\ \ln a}$f′(x)f(x) lna​

#### Practice question

##### Question 5

Differentiate $f\left(x\right)=\log_5\left(4x+2\right)-6x$f(x)=log5(4x+2)6x.

### Outcomes

#### 0606C14.3C

Use the derivatives of the standard functions e^x, ln x, together with constant multiples, sums and composite functions.