The portal has been deactivated. Please contact your portal admin.

Lesson Video: Logarithmic Differentiation Mathematics

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.

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