### 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.