# Logarithmic Differentiation

The method of differentiating functions by first taking logarithms and then differentiating is called logarithmic differentiation. We use logarithmic differentiation in situations where it is easier to differentiate the logarithm of a function than to differentiate the function itself. This approach allows calculating derivatives of power, rational and some irrational functions in an efficient manner.

Consider this method in more detail. Let $$y = f\left( x \right)$$. Take natural logarithms of both sides:

$\ln y = \ln f\left( x \right).$

Next, we differentiate this expression using the chain rule and keeping in mind that $$y$$ is a function of $$x.$$

${{\left( {\ln y} \right)^\prime } = {\left( {\ln f\left( x \right)} \right)^\prime },\;\;}\Rightarrow {\frac{1}{y}y’\left( x \right) = {\left( {\ln f\left( x \right)} \right)^\prime }.}$

It’s seen that the derivative is

${y’ = y{\left( {\ln f\left( x \right)} \right)^\prime } } = {f\left( x \right){\left( {\ln f\left( x \right)} \right)^\prime }.}$

The derivative of the logarithmic function is called the logarithmic derivative of the initial function $$y = f\left( x \right).$$

This differentiation method allows to effectively compute derivatives of power-exponential functions, that is functions of the form

$y = u{\left( x \right)^{v\left( x \right)}},$

where $$u\left( x \right)$$ and $$v\left( x \right)$$ are differentiable functions of $$x.$$

In the examples below, find the derivative of the function $$y\left( x \right)$$ using logarithmic differentiation.

## Solved Problems

Click or tap a problem to see the solution.

### Example 1

$y = {x^x},\;x \gt 0.$

### Example 2

$y = {x^{{\frac{1}{x}}}},\;x \gt 0.$

### Example 3

$y = {x^{\ln x}},\;x \gt 0.$

### Example 4

$y = {x^{\cos x}},\;x \gt 0.$

### Example 5

$y = {x^{\arctan x}},\;x \gt 0.$

### Example 6

${y = {x^{2x}}\;\;}\kern0pt{\left( {x \gt 0,\;x \ne 1} \right)}$

### Example 7

$y = {\left( {x – 1} \right)^2}{\left( {x – 3} \right)^5}$

### Example 8

$y = {\left( {x + 1} \right)^2}{\left( {x – 2} \right)^4}$

### Example 9

${y = {\frac{{{{\left( {x – 2} \right)}^2}}}{{{{\left( {x + 5} \right)}^3}}}},\;}\kern0pt{x \gt 2.}$

### Example 10

${y\left( x \right) }={ \frac{{{{\left( {x + 1} \right)}^2}}}{{{{\left( {x + 2} \right)}^3}{{\left( {x + 3} \right)}^4}}},\;\;}\kern-0.3pt{x \gt – 1.}$

### Example 11

$y = \sqrt[\large x\normalsize]{x},\;x \gt 0.$

### Example 12

$y = {\left( {\ln x} \right)^x},\;x \gt 1.$

### Example 13

$y = {\left( {{e^x}} \right)^{{e^x}}}.$

### Example 14

$y = {\left( {\ln x} \right)^{\ln x}},\;x \gt 1.$

### Example 15

${y = {x^{{x^2}}}\;\;}\kern-0.3pt{\left( {x \gt 0,\;x \ne 1} \right)}$

### Example 16

${y = {x^{{x^n}}}\;\;}\kern-0.3pt{\left( {x > 0,\;x \ne 1} \right)}$

### Example 17

${y = {x^{{2^x}}}\;\;}\kern-0.3pt{\left( {x > 0,\;x \ne 1} \right)}$

### Example 18

${y = {2^{{x^x}}}\;\;}\kern-0.3pt{\left( {x > 0,\;x \ne 1} \right)}$

### Example 19

${y = {x^{\sqrt x }}\;\;}\kern-0.3pt{\left( {x \gt 0,\;x \ne 1} \right)}$

### Example 20

${y = {x^{{x^x}}}\;\;}\kern-0.3pt{\left( {x \gt 0,\;x \ne 1} \right)}$

### Example 21

${y = {\sqrt x ^{\sqrt x }}\;\;}\kern-0.3pt{\left( {x \gt 0,\;x \ne 1} \right)}$

### Example 22

$y = {\left( {\sin x} \right)^{\cos x}}$

### Example 23

${y = \sqrt[3]{{{\frac{{x – 2}}{{x + 2}}}}},\;}\kern0pt{x \gt 2.}$

### Example 24

${y = \sqrt[\large 3\normalsize]{{\frac{{{x^2} – 3}}{{1 + {x^5}}}}},\;\;}\kern-0.3pt{x \gt \sqrt 3 .}$

### Example 25

$y = {\left( {\cos x} \right)^{\arcsin x}}$

### Example 26

$y = {\left( {\sin x} \right)^{\arctan x}}$

### Example 1.

$y = {x^x},\;x \gt 0.$

Solution.

First we take logarithms of the left and right side of the equation:

${\ln y = \ln {x^x},\;\;}\Rightarrow {\ln y = x\ln x.}$

Now we differentiate both sides meaning that $$y$$ is a function of $$x:$$

${{\left( {\ln y} \right)^\prime } = {\left( {x\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{1}{y} \cdot y’ = x’\ln x + x{\left( {\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{{y’}}{y} = 1 \cdot \ln x + x \cdot \frac{1}{x},\;\;}\Rightarrow {\frac{{y’}}{y} = \ln x + 1,\;\;}\Rightarrow {y’ = y\left( {\ln x + 1} \right),\;\;}\Rightarrow {y’ = {x^x}\left( {\ln x + 1} \right),\;\;}\kern0pt{\text{where}\;\;x \gt 0.}$

### Example 2.

$y = {x^{{\frac{1}{x}}}},\;x \gt 0.$

Solution.

First we take logarithms of both sides:

${\ln y = \ln {x^{\frac{1}{x}}},}\;\; \Rightarrow {\ln y = \frac{1}{x}\ln x.}$

Differentiate the last equation with respect to $$x:$$

${\left( {\ln y} \right)^\prime = \left( {\frac{1}{x}\ln x} \right)^\prime,}\;\; \Rightarrow {\frac{1}{y} \cdot y^\prime = \left( {\frac{1}{x}} \right)^\prime\ln x + \frac{1}{x}\left( {\ln x} \right)^\prime,}\;\; \Rightarrow {\frac{{y^\prime}}{y} = – \frac{1}{{{x^2}}} \cdot \ln x + \frac{1}{x} \cdot \frac{1}{x},}\;\; \Rightarrow {\frac{{y^\prime}}{y} = \frac{1}{{{x^2}}}\left( {1 – \ln x} \right),}\;\; \Rightarrow {y^\prime = \frac{y}{{{x^2}}}\left( {1 – \ln x} \right).}$

Substitute the original function instead of $$y$$ in the right-hand side:

${y^\prime = \frac{{{x^{\frac{1}{x}}}}}{{{x^2}}}\left( {1 – \ln x} \right) }={ {x^{\frac{1}{x} – 2}}\left( {1 – \ln x} \right) }={ {x^{\frac{{1 – 2x}}{x}}}\left( {1 – \ln x} \right).}$

### Example 3.

$y = {x^{\ln x}},\;x \gt 0.$

Solution.

Apply logarithmic differentiation:

${\ln y = \ln \left( {{x^{\ln x}}} \right),\;\;}\Rightarrow {\ln y = \ln x\ln x = {\ln ^2}x,\;\;}\Rightarrow {{\left( {\ln y} \right)^\prime } = {\left( {{{\ln }^2}x} \right)^\prime },\;\;}\Rightarrow {\frac{{y’}}{y} = 2\ln x{\left( {\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{{y’}}{y} = \frac{{2\ln x}}{x},\;\;}\Rightarrow {y’ = \frac{{2y\ln x}}{x},\;\;}\Rightarrow {y’ = \frac{{2{x^{\ln x}}\ln x}}{x} }={ 2{x^{\ln x – 1}}\ln x.}$

### Example 4.

$y = {x^{\cos x}},\;x \gt 0.$

Solution.

Take the logarithm of the given function:

${\ln y = \ln \left( {{x^{\cos x}}} \right),\;\;}\Rightarrow {\ln y = \cos x\ln x.}$

Differentiating the last equation with respect to $$x,$$ we obtain:

${{\left( {\ln y} \right)^\prime } = {\left( {\cos x\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{1}{y} \cdot y’ }={ {\left( {\cos x} \right)^\prime }\ln x + \cos x{\left( {\ln x} \right)^\prime },\;\;}\Rightarrow {{\frac{{y’}}{y} }={ \left( { – \sin x} \right) \cdot \ln x + \cos x \cdot \frac{1}{x},\;\;}}\Rightarrow {{\frac{{y’}}{y} }={ – \sin x\ln x + \frac{{\cos x}}{x},\;\;}}\Rightarrow {{y’ }={ y\left( {\frac{{\cos x}}{x} – \sin x\ln x} \right).}}$

Substitute the original function instead of $$y$$ in the right-hand side:

${y’ = {x^{\cos x}}\cdot}\kern0pt{\left( {\frac{{\cos x}}{x} – \sin x\ln x} \right),}$

where $$x \gt 0.$$

### Example 5.

$y = {x^{\arctan x}},\;x \gt 0.$

Solution.

Taking logarithms of both sides, we get

${\ln y = \ln {x^{\arctan x}},}\;\; \Rightarrow {\ln y = \arctan x\ln x.}$

Differentiate this equation with respect to $$x:$$

${\left( {\ln y} \right)^\prime = \left( {\arctan x\ln x} \right)^\prime,}\;\; \Rightarrow {\frac{1}{y} \cdot y^\prime = \left( {\arctan x} \right)^\prime\ln x }+{ \arctan x\left( {\ln x} \right)^\prime,}\;\; \Rightarrow {\frac{{y^\prime}}{y} = \frac{1}{{1 + {x^2}}} \cdot \ln x }+{ \arctan x \cdot \frac{1}{x},}\;\; \Rightarrow {\frac{{y^\prime}}{y} = \frac{{\ln x}}{{1 + {x^2}}} }+{ \frac{{\arctan x}}{x},}\;\; \Rightarrow {y^\prime = y\left( {\frac{{\ln x}}{{1 + {x^2}}} + \frac{{\arctan x}}{x}} \right),}$

where $$y = {x^{\arctan x}}.$$

### Example 6.

${y = {x^{2x}}\;\;}\kern0pt{\left( {x \gt 0,\;x \ne 1} \right)}$

Solution.

Taking logarithms of both sides, we can write the following equation:

${\ln y = \ln {x^{2x}},\;\;} \Rightarrow {\ln y = 2x\ln x.}$

Further we differentiate the left and right sides:

${{\left( {\ln y} \right)^\prime } = {\left( {2x\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{1}{y} \cdot y’ }={ {\left( {2x} \right)^\prime } \cdot \ln x + 2x \cdot {\left( {\ln x} \right)^\prime },\;\;}\Rightarrow {\frac{{y’}}{y} = 2 \cdot \ln x + 2x \cdot \frac{1}{x},\;\;}\Rightarrow {\frac{{y’}}{y} = 2\ln x + 2,\;\;}\Rightarrow {y’ = 2y\left( {\ln x + 1} \right)\;\;}\kern0pt{\text{or}\;\;y’ = 2{x^{2x}}\left( {\ln x + 1} \right).}$

Page 1
Problems 1-6
Page 2
Problems 7-26