Lesson Explainer: Logarithmic Differentiation | Nagwa Lesson Explainer: Logarithmic Differentiation | Nagwa

Lesson Explainer: Logarithmic Differentiation Mathematics • Third Year of Secondary School

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

In this explainer, we will learn how to find the derivatives of positive functions by taking the natural logarithm of both sides before differentiating.

We sometimes encounter functions we would like to differentiate but on which our usual methods, such as the chain, product, or quotient rules, are difficult to or cannot be directly applied. For example, in each of the functions below, it is not clear how we might differentiate each function with respect to 𝑥: 𝑦=5𝑥,𝑦=3,𝑦=4𝑥9,𝑦=𝑥𝑥5.costan

Each of these functions has a complicated exponent involving the variable 𝑥, which makes applying our usual rules of differentiation problematic. In such cases, one method we can use to differentiate is logarithmic differentiation.

Definition: Logarithmic Differentiation

Logarithmic differentiation is a four-step process used to differentiate awkward or complicated functions that do not lend themselves easily, if at all, to the usual methods of differentiation. For a differentiable function 𝑦=𝑓(𝑥)𝑦>0, the steps are as follows:

  1. Apply the natural logarithm to both sides lnln𝑦=𝑓(𝑥), where the natural logarithm lnlog𝑓(𝑥)=𝑓(𝑥).
  2. Use the laws of logarithms to simplify or distribute the right-hand side.
  3. Differentiate both sides with respect to 𝑥.
  4. Solve for 𝑦=𝑦𝑥dd.

Note that while we have specified that these steps apply when 𝑦>0, if we want to apply logarithmic differentiation for all values of 𝑦0, we take the natural logarithm of the absolute value of 𝑦: ln|𝑦. This then covers both positive and negative values of our function 𝑦.

Aside from taking the natural logarithm, the key step that makes this process so useful is the second step: using the laws of logarithms to simplify the right-hand side. This is because,

  • if 𝑓(𝑥) involves a product, then ln𝑓(𝑥) involves a sum, since by the product rule for logarithms logloglog𝑏𝑐=𝑏+𝑐,
  • if 𝑓(𝑥) involves a quotient, then ln𝑓(𝑥) involves a difference, since by the quotient rule for logarithms logloglog𝑏𝑐=𝑏𝑐,
  • if 𝑓(𝑥) involves an exponent or power, then ln𝑓(𝑥) involves a product, since by the law of exponents for logarithms loglog𝑏=𝑐𝑏.

Once we have rewritten our function in a more manageable form, we can then differentiate the resulting expressions using the usual methods and/or known results.

On the left-hand side of our equation, lnln𝑦=𝑓(𝑥), and since we are now differentiating a function of 𝑦 where 𝑦 is itself a function of 𝑥, we use implicit differentiation. This involves the chain rule for differentiating a composite function where dddddd𝑥𝑔((𝑥))=𝑔𝑥. Applying this to our left-hand side, differentiating with respect to 𝑥 gives us ddlnddlndddd𝑥𝑦=𝑦𝑦𝑦𝑥=𝑓𝑥.

Then, using the known result ddln𝑦𝑦=1𝑦(𝑦0), we have 1𝑦𝑦𝑥=𝑓𝑥𝑦𝑥=𝑦𝑓𝑥.dddddddd

Now that we know the steps to follow for logarithmic differentiation, let us try them out on some quite complicated functions.

Example 1: Finding the First Derivative of a Function Having a Variable in Its Base and Exponent Using Logarithmic Differentiation

Find dd𝑦𝑥 if 6𝑦=7𝑥.

Answer

Let us begin by isolating 𝑦 on the left-hand side. Dividing both sides by 6, we have 𝑦=76𝑥.

Since our function is an exponential function whose base and exponent are variables, we use the process of logarithmic differentiation to evaluate its derivative. Our first step in logarithmic differentiation is to take the natural logarithms of both sides. This gives us lnln𝑦=76𝑥𝑦>0.

In taking the natural logarithm, we have specified that 𝑦>0 since the logarithm is only defined for positive, nonzero input values. Our second step in logarithmic differentiation is to use the laws of logarithms to simplify our right-hand side. In this case, we note that our function consists of the variable 𝑥 with the exponent 35𝑥, all multiplied by the constant 76. We first use the product rule for logarithms, logloglog𝑏𝑐=𝑏+𝑐, to separate the constant. Thus, lnlnln𝑦=76+𝑥.

We may then use the power rule for logarithms, loglog𝑏=𝑐𝑏, to expand the second term on the right-hand side and bring our exponent down. This gives us lnlnln𝑦=76+35𝑥𝑥.

Our function is now in a form amenable to the usual rules of differentiation, so we can apply step three of logarithmic differentiation. That is, we can differentiate both sides with respect to 𝑥. Since the derivative of a sum of two functions is equal to the sum of their derivatives, we have ddlnddlnddln𝑥𝑦=𝑥76+𝑥35𝑥𝑥.

Applying implicit differentiation to our left-hand side, where 𝑦 is a function of 𝑥, gives us ddlndd𝑥𝑦=1𝑦𝑦𝑥, and since ln76 is a constant, its derivative is zero. We therefore have 1𝑦𝑦𝑥=𝑥35𝑥𝑥.ddddln

On the right-hand side, we are differentiating a product of two functions and can therefore use the product rule for differentiation. We know that the derivative of ln𝑥 with respect to 𝑥 is 1𝑥 and that the derivative of 35𝑥=35𝑥 with respect to 𝑥 is 35𝑥. Hence, by the product rule for differentiation, we have 1𝑦𝑦𝑥=35𝑥1𝑥+𝑥35𝑥=35𝑥[1𝑥].ddlnln

Our final step in logarithmic differentiation is to isolate dd𝑦𝑥 on the left-hand side. To do this, we multiply both sides by 𝑦. And since 𝑦=76𝑥 , we have ddlnln𝑦𝑥=76𝑥35𝑥[1𝑥]=710𝑥𝑥[1𝑥].

Combining exponents of 𝑥, we then have ddln𝑦𝑥=710𝑥[1𝑥].

Let us now consider an example of how to use logarithmic differentiation to differentiate a function involving a trigonometric ratio with a variable exponent.

Example 2: Differentiating Functions Involving Trigonometric Ratios Using Logarithmic Differentiation

Use logarithmic differentiation to find the derivative of the function 𝑦=2(𝑥)cos.

Answer

Logarithmic differentiation is useful when a function we wish to differentiate does not lend itself to the usual rules of differentiation. This is the case in the given function, where both the argument of the cosine and the exponent are variable. Our first step in logarithmic differentiation is to apply the natural logarithm to both sides of our function so that lnlncos𝑦=2(𝑥),𝑦>0.

In taking the natural logarithm, we have specified that 𝑦>0 since the logarithm is only defined for positive, nonzero input values. We then use the laws of logarithms to expand the right-hand side into something we can easily differentiate. To separate the constant, 2, from (𝑥)cos, we use the product rule for logarithms: logloglog𝑏𝑐=𝑏+𝑐.

Applying this rule gives us lnlnlncos𝑦=2+(𝑥).

Our second term on the right-hand side involves an exponent (𝑥), so we can apply the power rule for logarithms, loglog𝑏=𝑐𝑏, to bring our exponent 𝑥 down: lnlnlncos𝑦=2+𝑥𝑥.

As hoped, on our right-hand side we now have a collection of expressions that we are able to easily differentiate. Thus, we can apply the third step in logarithmic differentiation. That is, we differentiate both sides with respect to 𝑥. And since the derivative of a sum of two functions is equal to the sum of their derivatives, we have ddlnddlnddlncos𝑥𝑦=𝑥2+𝑥[𝑥𝑥].

Applying implicit differentiation to our left-hand side, where 𝑦 is a function of 𝑥, gives us ddlndd𝑥𝑦=1𝑦𝑦𝑥, and since ln2 is a constant so that its derivative is zero, we have, 1𝑦𝑦𝑥=𝑥[𝑥𝑥].ddddlncos

On our right-hand side, we are now differentiating a product with factors 𝑥 and lncos𝑥 and can therefore apply the product rule for differentiation. In order to do this, however, we will need to know the derivative of lncos𝑥 with respect to 𝑥. Since this is a function of a function, in other words, a composite function, we can apply the chain rule. Letting 𝑣()=ln, where (𝑥)=𝑥cos, then dd𝑣=1 and dddddddd𝑣𝑥=𝑣𝑥=1𝑥.

And since (𝑥)=𝑥cos, we have ddcossintan𝑣𝑥=1𝑥(𝑥)=𝑥.

We are now able to apply the product rule for differentiation to our right-hand side above. Letting 𝑢=𝑥 and 𝑣=𝑥lncos, so that dd𝑢𝑥=1 and ddtan𝑣𝑥=𝑥, by the product rule, ddddddtanlncoslncostan𝑥(𝑢𝑣)=𝑢𝑣𝑥+𝑣𝑢𝑥=𝑥(𝑥)+1𝑥=𝑥𝑥𝑥.

Having taken the natural logarithm on both sides and then differentiated with respect to 𝑥, we then have 1𝑦𝑦𝑥=𝑥𝑥𝑥.ddlncostan

Our final step in logarithmic differentiation is to isolate dd𝑦𝑥 on the left-hand side. We do this by multiplying both sides by 𝑦 to obtain ddlncostan𝑦𝑥=𝑦[𝑥𝑥𝑥].

Now, recalling that our function 𝑦=2(𝑥)cos, we have ddcoslncostan𝑦𝑥=2(𝑥)[𝑥𝑥𝑥].

In our next example, we use logarithmic differentiation to differentiate a composite function with variable exponent.

Example 3: Finding the First Derivative of a Function Using Logarithmic Differentiation

Find dd𝑦𝑥 if 𝑦=6𝑥+7.

Answer

If the exponent outside the parentheses in our function were a constant, we would simply use the chain rule to differentiate. However, the exponent is itself a function of 𝑥 and the easiest way to tackle differentiating a function of this type is to use logarithmic differentiation.

The first step is to apply the natural logarithm to both sides of our function so that lnln𝑦=6𝑥+7𝑦>0.

In taking the natural logarithm, we have specified that 𝑦>0, since the logarithm is only defined for positive, nonzero input values. We then use the laws of logarithms to expand the right-hand side into something we can easily differentiate. Our right-hand side involves an exponent (8𝑥) so we can apply the power rule for logarithms, loglog𝑏=𝑐𝑏, to bring our exponent down: lnln𝑦=8𝑥6𝑥+7.

On our right-hand side we now have a function that is the product of two differentiable functions that we know how to differentiate. Thus, we can apply the third step in logarithmic differentiation. That is, we differentiate both sides with respect to 𝑥 so that ddlnddln𝑥𝑦=𝑥8𝑥6𝑥+7.

Applying implicit differentiation to our left-hand side, where 𝑦 is a function of 𝑥, gives us ddlndd𝑥𝑦=1𝑦𝑦𝑥 so that 1𝑦𝑦𝑥=𝑥8𝑥6𝑥+7.ddddln

On our right-hand side, we are now differentiating a product with factors 8𝑥 and ln6𝑥+7. This means we can apply the product rule for differentiation. To do this, however, we need to know the derivative of ln6𝑥+7 with respect to 𝑥. Since this is a function of a function, we can apply the chain rule. Letting 𝑣()=ln, where (𝑥)=6𝑥+7, then dd𝑣=1 and dddddddd𝑣𝑥=𝑣𝑥=1𝑥.

Since (𝑥)=6𝑥+7 so that dd𝑥=54𝑥, we then have dd𝑣𝑥=1(6𝑥+7)54𝑥, and we can now apply the product rule for differentiation to the right-hand side above. Letting 𝑢=8𝑥 and 𝑣=6𝑥+7ln so that ddanddd𝑢𝑥=8𝑣𝑥=54𝑥(6𝑥+7), by the product rule, ddddddln𝑥(𝑢𝑣)=𝑢𝑣𝑥+𝑣𝑢𝑥=8𝑥54𝑥(6𝑥+7)+6𝑥+78.

Rearranging and taking the common factor of 8 outside the parentheses, we now have 1𝑦𝑦𝑥=86𝑥+7+54𝑥(6𝑥+7).ddln

Our final step in logarithmic differentiation is to isolate dd𝑦𝑥 on the left-hand side. We do this by multiplying both sides by 𝑦 to obtain ddln𝑦𝑥=8𝑦6𝑥+7+54𝑥(6𝑥+7).

We may want the derivative purely in terms of 𝑥, so with 𝑦=6𝑥+7, we have ddln𝑦𝑥=86𝑥+76𝑥+7+54𝑥(6𝑥+7).

Let us now consider an example where we use logarithmic differentiation to differentiate a function which is a constant raised to a complicated exponent involving exponential and trigonometric functions.

Example 4: Differentiating a Composition of Exponential and Trigonometric Functions Using Logarithmic Differentiation

Given that 𝑦=2sin, determine dd𝑦𝑥.

Answer

Considering that the exponent in our function is a complicated function of 𝑥, the easiest method we have to differentiate this function is by using logarithmic differentiation. Our first step in this process is to take the natural logarithms of both sides, giving us lnln𝑦=2𝑦>0.sin

In taking natural logarithms, we have specified that 𝑦>0 since the logarithm is only defined for positive, nonzero input values. Although this looks possibly even more complicated, our next step will help us simplify things so that we are able to differentiate quite easily. The second step of logarithmic differentiation is to use the laws of logarithms to change our right-hand side into something more manageable. In our case, since we have an exponent, we use the power rule, or law of exponents for logarithms, loglog𝑏=𝑐𝑏.

Using this to bring down our exponent gives us lnsinln𝑦=9𝑒+𝑥2, and on our right-hand side now we have the constant, ln2, multiplied by the expression 9𝑒+𝑥sin. We know how to differentiate this, so we apply step three of logarithmic differentiation. That is, we differentiate both sides with respect to 𝑥, giving ddlnlnddsin𝑥𝑦=2𝑥9𝑒+𝑥 (taking the constant, ln2, outside of the derivative).

Applying implicit differentiation to the left-hand side, where 𝑦 is a function of 𝑥, we have 1𝑦𝑦𝑥=2𝑥9𝑒+𝑥.ddlnddsin

Now recalling that dddd𝑥𝑒=𝑒𝑥𝑢(𝑥)()() and ddsincos𝑥𝑥=𝑥, differentiating the right-hand side gives us 1𝑦𝑦𝑥=281𝑒+𝑥.ddlncos

Our final step in logarithmic differentiation is to isolate dd𝑦𝑥 on the left-hand side. We can do this by multiplying both sides by 𝑦 so that ddlncos𝑦𝑥=𝑦281𝑒+𝑥.

Finally recalling that 𝑦=2sin and rearranging our right-hand side, we have ddcosln𝑦𝑥=281𝑒+𝑥2.sin

In our final example, we will use logarithmic differentiation to differentiate a slightly strange function with repeated exponents of 𝑥.

Example 5: Finding the First Derivative of a Function in the Form 𝑥𝑥𝑥 Using Logarithmic Differentiation

Given 𝑦=𝑥, find dd𝑦𝑥.

Answer

The exponents in the given function are variables and the easiest way to differentiate a function of this type is using logarithmic differentiation. To do this, we first take the natural logarithms on both sides. Applying this to our function 𝑦, we have lnln𝑦=𝑥𝑦>0.

In taking natural logarithms, we have specified that 𝑦>0, since the logarithm is only defined for positive, nonzero input values.

Our next step in logarithmic differentiation is to use the laws of logarithms to expand our right-hand side. This should give us something that we can easily differentiate, although with this particular function we will see that we must apply these first two steps twice to reach the point where we can differentiate.

Since our function involves exponents, we can use the power or exponent law for logarithms to expand our right-hand side. This says that loglog𝑏=𝑐𝑏, and applying it to our function so that we bring down our exponent, we have lnln𝑦=𝑥𝑥.

This appears a little more manageable since we now have a product on our right-hand side. However, one of the factors, 𝑥, is still not something we can easily differentiate. To remedy this, we return to step one and again take natural logarithms on both sides. By doing this, we will then be able to again apply the laws of logarithms to expand our right-hand side. So, taking the natural logarithms once more, we have lnlnlnln(𝑦)=[𝑥𝑥].

Now, on our right-hand side, we can use the product rule for logarithms; that is, logloglog𝑏𝑐=𝑏+𝑐.

Applying this to our right-hand side, we have lnlnlnlnln(𝑦)=𝑥+(𝑥).

We can use the power rule for logarithms once more to expand the first term on the right-hand side so that we have lnlnlnlnln(𝑦)=𝑥𝑥+(𝑥), and now we have something we can actually differentiate using the usual rules of differentiation. This brings us to our third step of logarithmic differentiation, which is to differentiate both sides with respect to 𝑥: ddlnlnddlnddlnln𝑥(𝑦)=𝑥(𝑥𝑥)+𝑥(𝑥) (noting that on the right-hand side we have used the fact that the derivative of a sum is equal to the sum of the derivatives). Let us begin our differentiation with the first term on the right-hand side.

We have a product with factors 𝑥 and ln𝑥. Using the product rule for differentiation and the fact that ddln𝑥𝑥=1𝑥, then ddlnlnln𝑥(𝑥𝑥)=𝑥1𝑥+𝑥1=1+𝑥.

Considering now the second term on our right-hand side, we may observe that the technique we will use applies similarly to the expression on the left-hand side. We have an expression, lnln(𝑥). This is of the form, ln𝑢, where 𝑢 is a differentiable function of 𝑥. So, we have a function of a function where, in our case, 𝑢(𝑥)=𝑥ln. We know that ddln𝑥𝑥=1𝑥 and that ddlndd𝑥𝑢=1𝑢𝑢𝑥 (for 𝑢>0). We therefore have ddlnlnlnln𝑥(𝑥)=1𝑥1𝑥=1𝑥𝑥.

We now have the derivatives of both terms of our right-hand side, so all that remains is to evaluate the derivative on the left-hand side of our equation. That is, ddlnln𝑥(𝑦). As noted, we can apply the same technique as used for the second term on our right-hand side.

Now we wish to differentiate the expression ln𝑢, where 𝑢=𝑦ln. This time we must take into account the fact that 𝑦 is a function of 𝑥, so ddlnlnlnddlnlnddlndd𝑥(𝑦)=1𝑦𝑥𝑦=1𝑦1𝑦𝑦𝑥=1𝑦𝑦𝑦𝑥.

We can now assemble the results of our differentiation as follows: 1𝑦𝑦𝑦𝑥=1+𝑥+1𝑥𝑥.lnddlnln

In the final step of logarithmic differentiation, we isolate dd𝑦𝑥 on the left-hand side by multiplying both sides by 𝑦𝑦ln and rearranging; we have ddlnlnln𝑦𝑥=(𝑦𝑦)𝑥+1𝑥𝑥+1.

We conclude our discussion of logarithmic differentiation by noting some key points.

Key Points

  • For complicated functions where the usual methods of differentiation are either difficult or impossible to apply, we use the method of logarithmic differentiation by taking the natural logarithm, where the natural logarithm “ln” is log. This is particularly useful when applied to functions involving a variable exponent.
  • For a differentiable function of 𝑥, 𝑦=𝑓(𝑥)𝑦>0, we
    • apply the natural logarithm to both sides lnln𝑦=𝑓(𝑥);
    • use the laws of logarithms loglogloglogloglogloglog𝑏𝑐=𝑏+𝑐,𝑏𝑐=𝑏𝑐,𝑏=𝑐𝑏 to simplify or expand the right-hand side;
    • differentiate both sides with respect to 𝑥;
    • solve for 𝑦=𝑦𝑥dd.
  • In taking natural logarithms on both sides, we specify that 𝑦>0 since the logarithm is only defined for positive, nonzero input values.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy