Lesson Video: Logarithmic Differentiation | Nagwa Lesson Video: Logarithmic Differentiation | Nagwa

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

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

17:16

Video Transcript

If we have a complicated function we’d like to differentiate, for example, a product, a quotient, or a power, we can use our knowledge of the derivative of the logarithm, the chain rule, and the properties of logs to find the derivative of our function. How this works is we take the logarithm of our function and use the laws of logarithms to expand or simplify our expression and then differentiate. We then solve for d𝑦 by d𝑥. In this video, we’ll see how this works and look at some examples.

Suppose we have a function 𝑦 is 𝑓 of 𝑥 and that our function is too complicated to differentiate using the usual rules. To use logarithmic differentiation, we first apply the natural logarithm to both sides so that we have ln 𝑦 or ln 𝑦 is the natural logarithm of 𝑓 of 𝑥, where the natural logarithm is the log to the base 𝑒 and where 𝑒 is Euler’s number, which to five decimal places is 2.71828. Once we’ve applied the natural logarithm to both sides, we can then use the laws of logarithms to expand our function. Our third step is to differentiate both sides with respect to 𝑥. And our final step is to solve for 𝑦 prime; that’s d𝑦 by d𝑥. Let’s look a little more closely at our steps here since there are some restrictions on this method to differentiation.

Since in step one we’re taking the logarithm on both sides, we need to be aware that logarithmic differentiation is only valid for values of 𝑓 of 𝑥 greater than zero. If we look at a graph of the log function, let’s call our variable 𝑢, we can see that the function doesn’t exist for values of 𝑢 less than or equal to zero. We can include negative values of our variable, but only if we take the log of the absolute values, which on a graph looks like this. Notice, though, that our function is still undefined for 𝑢 is equal to zero. And we know that for 𝑢 greater than zero, the derivative with respect to 𝑢 of ln 𝑢 is one over 𝑢. And in fact, for 𝑢 not equal to zero, the same applies for the derivative of the natural log of the absolute value of 𝑢. So our derivative in both cases is one over 𝑢.

So when using this method of differentiation, technically, we need to specify whether 𝑓 of 𝑥 is greater than zero, in which case we take the natural logs on both sides, or whether we’re specifying 𝑓 of 𝑥 is not equal to zero, in which case we take the natural logarithm of the absolute values on both sides. So we’re taking the natural logarithm on both sides, but how does this help us to differentiate a complicated function? Well, this is where our step two comes in. In step two, we use the laws of logarithms to expand the right-hand side.

Remember that logarithms turn products and quotients into sums so that the log of the product 𝑎𝑏 is the log of 𝑎 plus the log of 𝑏 and the log of the quotient 𝑎 over 𝑏 is the logarithm of 𝑎 minus the log of 𝑏 and also that logarithms turn powers into products. So the logarithm of 𝑎 raised to the power of 𝑏 is 𝑏 times the logarithm of 𝑎. And once we’ve expanded our function into a more manageable form using these laws, in step three, we differentiate the resulting expressions.

On the left-hand side, we’ll use implicit differentiation since we’re now differentiating a function of 𝑦, which is itself a function of 𝑥. And how does this work? Well, if we have a function 𝑔 ⁠— which is a function of 𝑦 which is a function of 𝑥, and that’s ℎ of 𝑥 ⁠— then on our left-hand side, d𝑔 by d𝑥 is equal to d𝑔 by d𝑦 times d𝑦 by d𝑥, which on the right-hand side is dℎ by d𝑥. We can then move to our step four, which is to solve for d𝑦 by d𝑥. And that gives us d𝑦 by d𝑥 is dℎ by d𝑥 divided by d𝑔 by d𝑦. Now remember, in our case, 𝑔 is the natural logarithm of 𝑦, which is 𝑓 of 𝑥. Let’s just make some space here.

So d𝑔 by d𝑥 is d𝑔 by d𝑦 times d𝑦 by d𝑥. And remember that d by d𝑢 of the fu⁠nction ln 𝑢 is one over 𝑢. So d𝑔 by d𝑦 is one over 𝑦. And we have d𝑔 by d𝑥 is one over 𝑦 times d𝑦 by d𝑥. And that’s equal to d𝑓 by d𝑥. So now, we can multiply through by 𝑦, which gives us d𝑦 by d𝑥 on the left-hand side is equal to 𝑦 times d𝑓 by d𝑥 on the right-hand side. And we have our derivative d𝑦 by d𝑥. Now, let’s see how logarithmic differentiation works in practice if our right-hand side is a product.

Suppose we have a function 𝑦, which is the product of functions 𝑓 of 𝑥 and 𝑔 of 𝑥. And we want to use logarithmic differentiation to find d𝑦 by d𝑥. We first take the natural logarithms of the absolute values on both sides. And we note that this is valid for 𝑦 not equal to zero. We can apply the product rule for logarithms to our right-hand side, where we’ve also used the product rule for absolute values. So our right-hand side is the natural logarithm of the absolute value of 𝑓 plus the natural logarithm of the absolute value of 𝑔.

Now, we want to differentiate both sides with respect to 𝑥, where on the right-hand side, we can use the fact that the derivative of a sum is the sum of the derivatives. On the left-hand side, we can use the fact that d by d𝑢 of the natural logarithm of the absolute value of 𝑢 is one over 𝑢 for 𝑢 nonzero. And recalling that 𝑦 is actually a function of 𝑥, we can use the chain rule. This says that if 𝑔 is a function of 𝑦 which is a function of 𝑥, then d𝑔 by d𝑥 is d𝑔 by d𝑦 times d𝑦 by d𝑥. In our case, 𝑔 is the natural logarithm of the absolute value of 𝑦. And using our result for the natural logarithm, the derivative with respect to 𝑦 is one over 𝑦, which by the chain rule we multiply by d𝑦 by d𝑥.

We use exactly the same process for each of the terms on the right-hand side so that we have one over 𝑦 times d𝑦 by d𝑥 is equal to one over 𝑓 d𝑓 by d𝑥 plus one over 𝑔 d𝑔 by d𝑥. To make things a little easier to see, let’s use the notation 𝑦 prime is d𝑦 by d𝑥. And now, if we multiply through by 𝑦, 𝑦 cancels on the left-hand side and we have 𝑦 times 𝑓 prime over 𝑓 plus 𝑦 times 𝑔 prime over 𝑔 on the right-hand side.

Remember, though, that 𝑦 is actually 𝑓 times 𝑔. And we can cancel an 𝑓 in the first term and a 𝑔 in the second term, and we’re left with 𝑦 prime is 𝑓 prime 𝑔 plus 𝑓 times 𝑔 prime, which is actually the product rule for differentiation. And what we’ve done is to show that the product rule for differentiation can be thought of as a consequence of the derivative of the logarithm. And in fact, the quotient rule for derivatives can be produced in a similar way. The main idea, however, is that for a function 𝑦, we took the natural logarithms on both sides and used the laws of logarithms to expand or break up our right-hand side. We then differentiated each component and then isolated 𝑦 prime or d𝑦 by d𝑥. So now that we know our steps, let’s try them out on an example where 𝑦 is a complicated function of 𝑥.

Find d𝑦 by d𝑥 if six 𝑦 is equal to seven 𝑥 raised to the power three over five 𝑥.

We’re asked to find the derivative with respect to 𝑥 of the function six 𝑦 is equal to seven 𝑥 raised to the power of three over five 𝑥. And before we begin, there are a couple of things we need to note about our equation here. The first is that on the left-hand side, we have six 𝑦 as opposed to 𝑦. Since 𝑦 is not by itself on the left, we call this an implicit function or equation. The second thing to notice that our exponent on the right-hand side is not a constant. In fact, our exponent involves a variable 𝑥. And because of this, we can’t use any of our usual rules for differentiation. What we can do to find d𝑦 by d𝑥 is to use logarithmic differentiation.

The first thing we can do is to isolate 𝑦 on the left-hand side by dividing through by six. We can then cancel the sixes on the left so that we have 𝑦 is equal to seven over six 𝑥 raised to the power three over five 𝑥. We now apply logarithmic differentiation. And our first step is to apply the natural logarithm to both sides. And remember that the natural logarithm is the logarithm to the base 𝑒, where, to five decimal places, 𝑒 which is Euler’s number is 2.71828 so that we have the natural logarithm of 𝑦 is the natural logarithm of 𝑓 of 𝑥. In our case, that’s the natural logarithm of seven over six times 𝑥 raised to the power three over five 𝑥.

We should note that for the logarithmic differentiation to be valid, we need to specify here that 𝑦 is greater than zero. That’s because the logarithm of zero is undefined and the function doesn’t exist for negative values. If we want to include negative values, we must include absolute value lines around 𝑦 and around 𝑓 of 𝑥. But in our case, we’ll simply assume that 𝑦 is greater than zero. Now, our function actually looks more complicated than it did in the first place. But this is where the use of the logarithms comes in. We use the laws of logarithms to expand our right-hand side. The first thing we can do is use the product rule for logs, which says that the log of 𝑎𝑏 is equal to the log of 𝑎 plus the log of 𝑏, so that on our right-hand side, we can split this up into the log of seven over six plus the natural log of 𝑥 raised to the power three over five 𝑥.

And we can expand further our second term using the power rule for logs. That’s the log of 𝑎 raised to the power 𝑏 is 𝑏 times the log of 𝑎. Our right-hand side is then the natural logarithm of seven over six plus three over five 𝑥 times the natural logarithm of 𝑥. Our third step in logarithmic differentiation is to differentiate both sides with respect to 𝑥. On our left-hand side, we’re differentiating a function of a function because 𝑦 is actually a function of 𝑥. And remember that if we have a function 𝑔 which is a function of 𝑦 which is a function of 𝑥, by the chain rule, we have d𝑔 by d𝑥 is equal to d𝑔 by d𝑦 times d𝑦 by d𝑥. And in our case, 𝑔 is the natural logarithm of 𝑦.

And now, we can use the result that the derivative of the natural logarithm of 𝑢 with respect to 𝑢 is one over 𝑢 for 𝑢 greater than zero so that on our left-hand side, we have one over 𝑦 times d𝑦 by d𝑥, where one over 𝑦 is our d𝑔 by d𝑦. And now, on the right-hand side, we know that the logarithm of seven over six is the logarithm of a constant is a constant, so the derivative of this is equal to zero. So now, we need to find the derivative of three over five 𝑥 times the logarithm of 𝑥. And for this, we can use the product rule for differentiation, where, in our case, 𝑓 is three over five 𝑥 and 𝑔 is the natural logarithm of 𝑥.

Noting that three over five 𝑥 is actually three over five times 𝑥 raised to the power negative one and this is a function of the form 𝑎 times 𝑥 raised to the 𝑛th power, then we can use the power rule for derivatives, which says that d by d𝑥 of 𝑎 times 𝑥 raised to the 𝑛th power is 𝑛 times 𝑎 times 𝑥 raised to the 𝑛 minus oneth power. That is, we multiply by the exponent and subtract one from the exponent. d by d𝑥 is three over five 𝑥 raised to the power negative one is negative three over five 𝑥 raised to the power negative two.

And recalling that the derivative of the natural logarithm of 𝑥 is one over 𝑥, so that in our product rule 𝑓 prime is negative three over five 𝑥 raised to the power negative two and 𝑔 prime is one over 𝑥, the derivative on our right-hand side is negative three over five 𝑥 squared, which is 𝑓 prime, times the natural logarithm of 𝑥, which is 𝑔, plus three over five 𝑥, which is 𝑓, times one over 𝑥, which is 𝑔 prime. Rearranging this, we have three over five 𝑥 squared minus three over five 𝑥 squared times the natural logarithm of 𝑥. And since we have a common factor of three over five 𝑥 squared, we can take this outside.

Now, remember, we’re trying to find d𝑦 by d𝑥. This means we need to isolate d𝑦 by d𝑥 on the left-hand side. We can do this by multiplying through by 𝑦. And this is our fourth step in our logarithmic differentiation. We can cancel the 𝑦’s on the left-hand side. And on the right-hand side, we have three 𝑦 over five 𝑥 squared times one minus the logarithm of 𝑥. Remember, though, that 𝑦 is equal to seven over six times 𝑥 raised to the power three over five 𝑥. And substituting this in, we can cancel a three so that our constant is actually seven over 10. So now, if we look at our powers of 𝑥, this is actually 𝑥 raised to the power three over five 𝑥 minus two. And we have d𝑦 by d𝑥 is equal to seven over 10 times 𝑥 raised to the power three over five 𝑥 minus two times one minus the natural logarithm of 𝑥.

So now, let’s look at another example of how we can use logarithmic differentiation to differentiate a function with a variable exponent, but this time involving a trigonometric function.

Use logarithmic differentiation to find the derivative of the function 𝑦 is equal to two times the cos of 𝑥 raised to the power 𝑥.

We’re asked to find the derivative of the function 𝑦 is two times the cos of 𝑥 raised to the power 𝑥. And we’re told to use logarithmic differentiation to do this. If we have a function 𝑦 is 𝑓 of 𝑥, then the first thing we do is to take the natural logarithms on both sides. Remember, the natural logarithm is the logarithm to the base 𝑒, where 𝑒 is Euler’s number, which to five decimal places is 2.71828. We need to specify that unless we take the absolute values of 𝑦 and 𝑓 of 𝑥, then 𝑦 must be greater than zero. This is because the logarithm of zero is undefined, and the logarithm doesn’t exist for negative values.

Technically, if we’re taking the absolute values of 𝑦 and 𝑓 of 𝑥 and then applying the natural logarithms, we cover ourselves for negative values. But we’ll simply state here that our solution is for positive 𝑦. And so we take the natural logarithm on both sides. And our second step is to use the laws of logarithms to expand our right-hand side. In our case, since our argument is a product, we can use the product rule for logarithms, which says that the logarithm of 𝑎 times 𝑏 is the logarithm of 𝑎 plus the logarithm of 𝑏. We have 𝑎 equal to two and 𝑏 equal to cos 𝑥 to the power 𝑥 so that we have the logarithm of two plus the logarithm of the cos of 𝑥 raised to power 𝑥.

And since now in our second term we have an exponent, we can use the power rule for logarithms, which says that the logarithm of 𝑎 raised to the power 𝑏 is 𝑏 times the logarithm of 𝑎. In our term, 𝑎 is equal to cos 𝑥 and the exponent 𝑏 is equal to 𝑥. So on our right-hand side, we have the natural logarithm of two plus 𝑥 times the natural logarithm of cos 𝑥. Our third step in logarithmic differentiation is to differentiate both sides with respect to 𝑥. On our right-hand side, we use the fact that the derivative of a sum is the sum of the derivatives. And on the left-hand side, we’ll use implicit differentiation. That’s because on the left-hand side, we have a function of 𝑦 which is itself a function of 𝑥.

And if we have a function 𝑔 which is a function of 𝑦 which is a function of 𝑥, then d𝑔 by d𝑥 is equal to d𝑔 by d𝑦 times d𝑦 by d𝑥, which is the chain rule for a function of a function. In our case, 𝑔 is the natural logarithm of 𝑦. And we can use the fact that the derivative with respect to 𝑢 of the natural logarithm of 𝑢 is equal to one over 𝑢 if 𝑢 is greater than zero. This gives us one over 𝑦 times d𝑦 by d𝑥 on our left-hand side. On our right-hand side, since the natural logarithm of two is a constant, its derivative is equal to zero. And for our second term, since we have a product, we can use the product rule for differentiation, where in our product rule 𝑓 is equal to the function 𝑥 and 𝑔 is equal the function the natural logarithm of cos 𝑥.

So now, with 𝑓 equal to 𝑥, let’s define ℎ as the function cos 𝑥 and then 𝑔 is equal to the logarithm of ℎ. And as well as the product rule for differentiation, we can use the chain rule. With 𝑓 equal to 𝑥, then d𝑓 by d𝑥 is equal to one, dℎ by d𝑥 is equal to negative sin 𝑥, and by the chain rule d𝑔 by d𝑥 is equal to d𝑔 by dℎ times dℎ by d𝑥, which by our derivative for logarithms is equal to one over ℎ times the negative sin 𝑥, which is negative sin 𝑥 over cos 𝑥. And since sin 𝑥 over cos 𝑥 is tan 𝑥, we have the negative tan of 𝑥.

Now remember, in our product rule, 𝑓 is equal to 𝑥 and 𝑔 is equal to the natural logarithm of cos 𝑥. So the derivative of our second term is 𝑓 prime times 𝑔, which is one times the natural logarithm of cos 𝑥, plus 𝑓 times 𝑔 prime, which is 𝑥 times the negative tan of 𝑥, that is, the natural logarithm of cos 𝑥 minus 𝑥 tan 𝑥.

Okay, so let’s tidy things up a little bit. And we have one over 𝑦 times d𝑦 by d𝑥 is equal to the natural logarithm of cos 𝑥 minus 𝑥 tan 𝑥. And our final step is to solve for d𝑦 by d𝑥. If we multiply through by 𝑦, we can cancel 𝑦 on the left-hand side. And remember that 𝑦 is actually equal to two times the cos of 𝑥 raised to the power 𝑥 so that d𝑦 by d𝑥 is equal to two times the cos of 𝑥 raised of the power 𝑥 times the natural logarithm of cos of 𝑥 minus 𝑥 tan 𝑥.

Let’s conclude our discussion of logarithmic differentiation with some key points. Suppose we have a function 𝑦 is 𝑓 of 𝑥, which we’d like to differentiate using logarithmic differentiation. Our first step is to take the natural logarithm on both sides, recalling that the natural logarithm is the logarithm to the base 𝑒. And that’s where 𝑒 is Euler’s number, which is approximately equal to 2.71828. So we have the natural logarithm of 𝑦 is the natural logarithm of 𝑓 of 𝑥. We need to specify that this is for 𝑦 greater than zero since the logarithm of zero does not exist. And the logarithm function doesn’t exist for negative values.

Alternatively, we can take the natural logarithm of the absolute values. This then covers values of 𝑦 which are both positive and negative but not zero. Our second step is to use the laws of logarithms to expand. We then differentiate with respect to 𝑥 and finally solve for d𝑦 by d𝑥. And we use logarithmic differentiation when our function is too complicated to apply the normal rules of differentiation to or, for example, when our exponent is a variable, not a constant.

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