(D9) Logarithmic Differentiation#

By the end of the lesson you will be able to:

  • compute derivatives using logarithmic differentiation.

Lecture Videos#


Properties of the Logarithmic Functions#

Properties

Let \(x\) and \(y\) be positive numbers, \(b\) any number.

  1. \(\ln (xy) = \ln x + \ln y\)

  2. \(\ln \left(\tfrac{x}{y}\right) = \ln x - \ln y\)

  3. \(\ln \left( x^b\right) = b \ln x\)

We have a log property that converts multiplication inside the log function into addition outside the log function:

\[ \ln (xy) = \ln x + \ln y \]

We have a log property that converts division inside the log function into subtraction outside the log function:

\[ \ln \left(\tfrac{x}{y}\right) = \ln x - \ln y \]

We have a log property that converts exponents applied to everything inside the log function into multiplication outside the log function:

\[ \ln \left( x^b\right) = b \ln x \]

Example 1#

Calculate the derivative of the function:

\[ f(x) = \ln \left( \dfrac{x+1}{\sqrt{x-2}}\right) \]

Example 4 (again)#

Let’s try it again! Calculate the derivative of the function:

\[ f(x) = \ln \left( \dfrac{x+1}{\sqrt{x-2}}\right) \]

Click through the tabs to see the steps of our solution.

In this example, we are going to first simplify our function using log properties.

Instead of differentiating right away, this time we’re going to first use our log properties to simplify the function first:

\[\begin{split} \begin{aligned} f(x) & = \ln \left( \dfrac{x+1}{\sqrt{x-2}}\right) & \\ & & \\ & = \ln \left( x+1 \right) - \ln \left( \sqrt{x-2}\right) & \text{Division to Subtraction}\\ & & \\ & = \ln \left( x+1 \right) - \ln \left( (x-2)^{1/2}\right) & \text{Rewrite Root}\\ & & \\ & = \ln \left( x+1 \right) - \tfrac{1}{2} \ln \left( x-2\right) & \text{Exponent to Multiplication}\\ \end{aligned} \end{split}\]

This is as far as we can simplify our function. (Remember that there are no log properties for addition or subtraction inside the log function.)

With our function rewritten, we are now ready to differentiate:

\[\begin{split} \begin{aligned} f'(x) & = \bigg[\ln \left( x+1 \right) \bigg]' - \bigg[\tfrac{1}{2} \ln \left( x-2\right)\bigg]' \\ & \\ & = \underbrace{\bigg[\ln \left( x+1 \right) \bigg]'}_{\text{Chain Rule}} - \underbrace{\bigg[\tfrac{1}{2} \ln \left( x-2\right)\bigg]'}_{\text{Chain Rule}} \\ & \\ & = \underbrace{\dfrac{1}{x+1} \cdot \big[x+1 \big]'}_{\text{Chain Rule}} - \tfrac{1}{2} \cdot\underbrace{ \dfrac{1}{x-2} \cdot \big[ x-2\big]'}_{\text{Chain Rule}} \\ & \\ & = {\dfrac{1}{x+1} \cdot (1)} - \tfrac{1}{2} \cdot{ \dfrac{1}{x-2} \cdot (1)} \\ & \\ & = {\dfrac{1}{x+1} } - { \dfrac{1}{2x-4} } \\ \end{aligned} \end{split}\]

There we go! With a little work, we could make this look like the other version of the derivative we had previously found. But wasn’t this easier?!


Example 2 (again)#

Try it again! Differentiate the following function using the technique of logarithmic differentiation.

\[ y = \big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4 \]

Click through the tabs to see the steps of our solution.

In this example, we are going to use the technique of logarithmic differentiation:

  1. Apply \(\ln(\cdot)\) to both sides.

  2. Simplify the right side.

  3. Use implicit differentiation to calculate \(y'\).

  4. Solve for \(y'\) and replace \(y\).

The first step is to apply the log function to both sides of the equation:

\[\begin{split} \begin{aligned} y \; & = \; \big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4 \\ & \\ \ln \bigg( \; y \; \bigg) & = \ln \bigg(\big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4 \bigg) \\ \end{aligned} \end{split}\]

The next step is to simplify using log properties, giving us:

\[\begin{split} \begin{aligned} \ln \bigg( \; y \; \bigg) & = \ln \bigg(\big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4 \bigg) & \\ & & \\ & = \ln \bigg( \big( 2x+1 \big)^5\bigg) + \ln \bigg( \big( x^3-x+1 \big)^4\bigg) & \times \xrightarrow{\text{log}} + \\ & & \\ & = 5 \ln \big( 2x+1 \big) + 4\ln \big( x^3-x+1 \big) & (\cdot)^r \xrightarrow{\text{log}} \times \\ \end{aligned} \end{split}\]

Now we’re ready to differentiate! However, notice that we no longer have an equation in the form \(y=\cdots\), meaning we need to use implicit differentiation.

\[\begin{split} \begin{aligned} \bigg[\ln y\bigg]' & = \bigg[ 5 \ln \big( 2x+1 \big)\bigg]' + \bigg[ 4\ln \big( x^3-x+1 \big)\bigg]' \\ & \\ \bigg[\ln y\bigg]' & = \underbrace{\bigg[ 5 \ln \big( 2x+1 \big)\bigg]'}_{\text{Chain Rule}} + \underbrace{\bigg[ 4\ln \big( x^3-x+1 \big)\bigg]'}_{\text{Chain Rule}} \\ & \\ \bigg[\ln y\bigg]' & = \underbrace{ 5 \cdot \dfrac{1}{2x+1}\big[2x+1 \big]'}_{\text{Chain Rule}} + \underbrace{ 4 \cdot \dfrac{1}{x^3-x+1} \big[ x^3-x+1 \big]'}_{\text{Chain Rule}} \\ & \\ \underbrace{\bigg[\ln y\bigg]'}_{\text{Chain Rule}} & = \dfrac{10}{2x+1}\ + 4 \cdot \dfrac{3x^2-1}{x^3-x+1} \\ & \\ \underbrace{\dfrac{1}{y}\cdot y'}_{\text{Chain Rule}} & = \dfrac{10}{2x+1}\ + \dfrac{12x^2-4}{x^3-x+1} \\ \end{aligned} \end{split}\]

Remember that since we are using implicit differentiation, we are viewing:

  • \(x\) as only a variable

  • \(y\) as both a variable and a function (which is why we need to use chain rule when differentiating \(\ln y\)).

We’re done differentiating, so now we need to solve for \(y'\). Multiplying both sides by \(y\), we get:

\[\begin{split} \begin{aligned} \dfrac{1}{y}\cdot y' & = \dfrac{10}{2x+1}\ + \dfrac{12x^2-4}{x^3-x+1} \\ & \\ y' & = y \cdot \left(\dfrac{10}{2x+1}\ + \dfrac{12x^2-4}{x^3-x+1}\right) \\ \end{aligned} \end{split}\]

Well, we’ve solved for \(y'\) but this is not quite done. We started with a function purely in terms of \(x\) and now we have a derivative in terms of \(x\) and \(y\). Not entirely satisfying.

But we actually know what \(y\) is equal to, it’s the original function we started with. Let’s plug this back in:

\[\begin{split} \begin{aligned} y' & = \underbrace{y}_{y=\big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4} \cdot \left(\dfrac{10}{2x+1}\ + \dfrac{12x^2-4}{x^3-x+1}\right) \\ & \\ & = \big( 2x+1 \big)^5 \big( x^3-x+1 \big)^4 \cdot \left(\dfrac{10}{2x+1}\ + \dfrac{12x^2-4}{x^3-x+1}\right) \\ \end{aligned} \end{split}\]

There’s our derivative!


Example 3 (again)#

Try it again! Differentiate the following function using the technique of logarithmic differentiation.

\[ g(t) = \left( \dfrac{t-2}{2t+1}\right)^9 \]

Click through the tabs to see the steps of our solution.

In this example, we are going to use the technique of logarithmic differentiation:

  1. Apply \(\ln(\cdot)\) to both sides.

  2. Simplify the right side.

  3. Use implicit differentiation to calculate \(y'\).

  4. Solve for \(y'\) and replace \(y\).

The first step is to apply the log function to both sides of the equation:

\[\begin{split} \begin{aligned} g(t) \; & = \; \left( \dfrac{t-2}{2t+1}\right)^9 \\ & \\ \ln \bigg( \; g(t) \; \bigg) & = \ln \Bigg(\left( \dfrac{t-2}{2t+1}\right)^9 \Bigg) \\ \end{aligned} \end{split}\]

The next step is to simplify using log properties, giving us:

\[\begin{split} \begin{aligned} \ln \bigg( \; g(t) \; \bigg) & = \ln \Bigg(\left( \dfrac{t-2}{2t+1}\right)^9 \Bigg) & \\ & & \\ & = 9\cdot \ln \bigg( \dfrac{t-2}{2t+1} \bigg) & (\cdot)^r \xrightarrow{\text{log}} \times \\ & & \\ & = 9\cdot \bigg( \ln (t-2) - \ln (2t+1)\bigg) & \div \text{inside}\xrightarrow{\text{log}} - \text{outside}\\ & & \\ & = 9 \ln (t-2) - 9\ln (2t+1) & \end{aligned} \end{split}\]

Now we’re ready to differentiate! However, notice that we no longer have an equation in the form \(g(t)=\cdots\), meaning we need to use implicit differentiation.

\[\begin{split} \begin{aligned} \ln \big( \; g(t) \; \big) & = 9 \ln (t-2) - 9\ln (2t+1) \\ & \\ \bigg[ \ln \big( \; g(t) \; \big) \bigg]' & = 9 \bigg[ \ln (t-2)\bigg]' - 9 \bigg[ \ln (2t+1)\bigg]' \\ & \\ \underbrace{\bigg[ \ln \big( \; g(t) \; \big) \bigg]'}_{\text{Chain Rule}} & = 9 \underbrace{\bigg[ \ln (t-2)\bigg]'}_{\text{Chain Rule}} - 9 \underbrace{\bigg[ \ln (2t+1)\bigg]'}_{\text{Chain Rule}} \\ & \\ \underbrace{ \dfrac{1}{g(t)} \cdot g'(t) }_{\text{Chain Rule}} & = 9 \cdot \underbrace{\dfrac{1}{t-2} \cdot \big[t-2\big]'}_{\text{Chain Rule}} - 9 \cdot \underbrace{\dfrac{1}{2t+1} \cdot \big[2t+1\big]'}_{\text{Chain Rule}} \\ & \\ \dfrac{1}{g(t)} \cdot g'(t) & = \dfrac{9}{t-2} \cdot (1) - \dfrac{9}{2t+1} \cdot (2) \\ & \\ \dfrac{1}{g(t)} \cdot g'(t) & = \dfrac{9}{t-2} - \dfrac{18}{2t+1} \\ \end{aligned} \end{split}\]

We’re done differentiating, so now we need to solve for \(g'(t)\). Multiplying both sides of the equation by \(g(t)\), gives us:

\[\begin{split} \begin{aligned} \dfrac{1}{g(t)} \cdot g'(t) & = \dfrac{9}{t-2} - \dfrac{18}{2t+1} \\ & \\ g'(t) & = g(t) \cdot \left(\dfrac{9}{t-2} - \dfrac{18}{2t+1}\right) \\ \end{aligned} \end{split}\]

We’ve solved for \(g'(t)\) but this is not quite done. We started with a function purely in terms of \(t\) and now we have a derivative in terms of \(t\) and \(g(t)\). Not exactly what we want.

However, we actually know what \(g(t)\) is equal to, it’s the original function we started with. Let’s plug this back in:

\[\begin{split} \begin{aligned} g'(t) & = \underbrace{g(t)}_{g(t) = \left( \dfrac{t-2}{2t+1}\right)^9} \cdot \left(\dfrac{9}{t-2} - \dfrac{18}{2t+1}\right) \\ & \\ & = \left( \dfrac{t-2}{2t+1}\right)^9 \cdot \left(\dfrac{9}{t-2} - \dfrac{18}{2t+1}\right) \\ \end{aligned} \end{split}\]

There’s our derivative!


Example 2#

Differentiate the following function using the technique of logarithmic differentiation.

\[ y = x^{\sqrt{x}} \]

Example 5#

Differentiate the following function using the technique of logarithmic differentiation.

\[ y = x^{\sqrt{x}} \]

Click through the tabs to see the steps of our solution.

In this example, we are going to use the technique of logarithmic differentiation:

  1. Apply \(\ln(\cdot)\) to both sides.

  2. Simplify the right side.

  3. Use implicit differentiation to calculate \(y'\).

  4. Solve for \(y'\) and replace \(y\).

The first step is to apply the log function to both sides of the equation:

\[\begin{split} \begin{aligned} y \; & = \; x^{\sqrt{x}} \\ & \\ \ln \bigg( \; y \; \bigg) & = \ln \bigg(x^{\sqrt{x}}\bigg) \\ \end{aligned} \end{split}\]

The next step is to simplify using log properties, giving us:

\[\begin{split} \begin{aligned} \ln \bigg( \; y \; \bigg) & = \ln \bigg(x^{\sqrt{x}}\bigg) \\ & & \\ & = \sqrt{x} \cdot \ln \big( x \big) & (\cdot)^r \xrightarrow{\text{log}} \times \\ \end{aligned} \end{split}\]

Now we’re ready to differentiate! However, notice that we no longer have an equation in the form \(y=\cdots\), meaning we need to use implicit differentiation. We’ll start by using Product Rule for the terms on the right.

\[\begin{split} \begin{aligned} \bigg[\ln \big( \; y \; \big)\bigg]' & = \underbrace{\bigg[\sqrt{x} \cdot \ln \big( x \big)\bigg]'}_{\text{Product Rule}} \\ & \\ \bigg[\ln \big( \; y \; \big)\bigg]'& = \underbrace{\bigg[\sqrt{x} \bigg]' \cdot \ln x + \sqrt{x} \bigg[ \ln x \ \bigg]' }_{\text{Product Rule}} \\ & \\ \underbrace{\bigg[\ln \big( \; y \; \big)\bigg]'}_{\text{Chain Rule}} & = \tfrac{1}{2}x^{-1/2} \cdot \ln x + \sqrt{x} \cdot\dfrac{1}{x} \\ & \\ \underbrace{\dfrac{1}{y}\cdot y'}_{\text{Chain Rule}} & = \underbrace{\tfrac{1}{2}x^{-1/2} \cdot \ln x + \sqrt{x} \cdot\dfrac{1}{x}}_{\text{simplify}} \\ & \\ \dfrac{1}{y}\cdot y' & = \dfrac{\ln x}{2\sqrt{x}} + \dfrac{1}{\sqrt{x}} \\ & \\ \dfrac{1}{y}\cdot y' & = \dfrac{2+\ln x}{2\sqrt{x}} \\ \end{aligned} \end{split}\]

The last few steps here where we simplify the terms on the right, are not exactly necessary, but they are helpful.

We’re done differentiating, so now we need to solve for \(y'\). Multiplying both sides of the equation by \(y\), gives us:

\[\begin{split} \begin{aligned} \dfrac{1}{y}\cdot y' & = \dfrac{2+\ln x}{2\sqrt{x}} \\ & \\ y' & = y \cdot \dfrac{2+\ln x}{2\sqrt{x}} \\ \end{aligned} \end{split}\]

We’ve solved for \(y'\) but this is not quite done. We need to replace the \(y\) currently in our derivative with our original function:

\[\begin{split} \begin{aligned} y' & = \underbrace{y}_{y = x^{\sqrt{x}}} \cdot \dfrac{2+\ln x}{2\sqrt{x}} \\ & \\ & = x^{\sqrt{x}} \cdot \dfrac{2+\ln x}{2\sqrt{x}} \\ \end{aligned} \end{split}\]

There’s our derivative!

Differentiating Powers#