# Video: Differentiating Functions Involving Trigonometric Ratios Using Logarithmic Differentiation

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

05:23

### Video Transcript

Use logarithmic differentiation to find the derivative of the function 𝑦 equals two cos 𝑥 to the power of 𝑥.

We want to find the derivative of 𝑦 equals two cos 𝑥 to the power of 𝑥. In other words, we want to find 𝑑𝑦 by 𝑑𝑥. And we’re given a hint as to how to do this. We’re told to use logarithmic differentiation. So what does logarithmic differentiation mean?

Well, the logarithmic part of a logarithmic differentiation is to take the natural logarithm on both sides of this equation. The differentiation part of logarithmic differentiation is to then differentiate both sides. But before we do that, let’s use some laws of logarithms to make the right-hand side easier to differentiate.

The first thing we can do is write the logarithm of a product as the sum of two logarithms. But this isn’t particularly helpful for the purposes of the logarithmic differentiation. The really helpful law of logarithms here is that the logarithm of 𝑎 to the power of 𝑏 is 𝑏 times the logarithm of 𝑎. So with 𝑎 equal to cos 𝑥 and 𝑏 equal to 𝑥, we find out the natural logarithm of 𝑦 ln 𝑦 is ln two plus 𝑥 ln cos 𝑥.

Okay, now that we’ve simplified as much as possible using the laws of logarithms, it’s time to move on to the differentiation part of logarithmic differentiation. And so we differentiate both sides with respect to 𝑥. Let’s clear some room to do this differentiating. How do we differentiate ln 𝑦 with respect to 𝑥? Well, we can apply the chain rule. With 𝑓 equal to ln 𝑦, then the quantity we’re looking for is 𝑑𝑓 by 𝑑𝑥.

And the chain rule tells us that this is 𝑑𝑓 by 𝑑𝑦 times 𝑑𝑦 by 𝑑𝑥. So here, we just apply the chain rule with 𝑓 equal to ln 𝑦. And what is 𝑑 ln 𝑦 by 𝑑𝑦 — the derivative of ln 𝑦 with respect to 𝑦? It’s just one over 𝑦. The derivative of the natural logarithm function is the reciprocal function.

Okay, now, we move on to the right-hand side, the derivative of a sum is the sum of the derivatives. And as the natural logarithm of two ln two is just a constant, its derivative with respect to 𝑥 is zero. We only have to worry about the other term. This is the derivative of the product of 𝑥 and ln cos 𝑥 with respect to 𝑥. So we should apply the product rule.

We apply the product rule. Take a moment here if you’d like to pause the video and check that we’ve applied it correctly. And we can see that the second term that we get is relatively straightforward. 𝑑 by 𝑑𝑥 of 𝑥 is just one. And so this term is just ln cos 𝑥. The other derivative is a bit more difficult. To compute it, we’re going to need the chain rule again.

If we let 𝑓 equal ln cos 𝑥, then we’re looking for 𝑑𝑓 by 𝑑𝑥. And let’s call our auxiliary variable in the chain rule 𝑧. Set 𝑧 equal to cos 𝑥 and then 𝑓 is just ln 𝑧. Here, I’ve just used the definition of 𝑓 to write 𝑑 by 𝑑𝑥 over ln cos 𝑥 as 𝑑𝑓 by 𝑑𝑥. Now, we can apply the chain rule. 𝑑𝑓 by 𝑑𝑥 is 𝑑𝑓 by 𝑑𝑧 times 𝑑𝑧 by 𝑑𝑥. What is 𝑑𝑓 by 𝑑𝑧? As 𝑓 is equal to ln 𝑧, 𝑑𝑓 by 𝑑𝑧 is one over 𝑧. And what was 𝑧? Well, it was our auxiliary variable, which redefines to be cos 𝑥.

So let’s replace 𝑧 by cos 𝑥 to get everything written in terms of 𝑥. Now, how about 𝑑𝑧 by 𝑑𝑥? Well, 𝑧 is still cos 𝑥 and the derivative of cos 𝑥 with respect to 𝑥 is minus sin 𝑥. So there we are, we’ve applied the chain rule. We found that the derivative of ln cos 𝑥 is one over cos 𝑥 times minus sin 𝑥, which we can of course write as a single fraction. This is minus sin 𝑥 over cos 𝑥, which we can further simplify to minus 10𝑥.

This is perhaps somewhat surprising and it turns out that this is a relatively useful fact later on. Anyway, remember we’re looking for 𝑑𝑦 by 𝑑𝑥. And we very nearly have it. On the left-hand side, we have one over 𝑦 𝑑𝑦 by 𝑑𝑥. And so we can multiply both sides by 𝑦 to find 𝑑𝑦 by 𝑑𝑥 in terms of 𝑥 and 𝑦. Whenever possible, we like to give 𝑑𝑦 by 𝑑𝑥 in terms of 𝑥 alone. And it is possible here because we can substitute two times cos 𝑥 to the 𝑥 for 𝑦.

Making this substitution, rearranging somewhat, and writing 𝑑𝑦 by 𝑑𝑥 as 𝑦 prime, we get our final answer 𝑦 prime is two cos 𝑥 to the 𝑥 times ln cos 𝑥 minus 𝑥 10𝑥.