Logarithmic Differentiation Notes
These Logarithmic Differentiation Notes explain how to differentiate a power whose base and exponent both contain x, such as x to the x, with the working shown line by line. Neither the power rule nor the exponential rule works on its own here, so the natural log of both sides is taken first. The log rule brings the power down in front, both sides are differentiated, and the result is multiplied back by the original function. Following the same pattern every time keeps the extra factor from being forgotten at the end.
Step-by-step method
- Set up the problem.
- Write the logarithmic differentiation formula.
- Take the natural log of both sides.
- Differentiate both sides, as Step 4a, Step 4b and Step 4c.
- Multiply both sides by y and put y back.
Formula: Logarithmic Differentiation
For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.
Useful Tips to Remember
Take the natural log of both sides, use the log laws to break products, quotients and powers apart, then differentiate both sides. The left side becomes \(\frac{1}{y}\frac{dy}{dx}\) by the chain rule. Multiply by \(y\) at the end and replace it with the original function. This method is needed for functions like \(x^x\), where the variable is in both the base and the exponent.
Required knowledge
- How to differentiate ln(x), covered in the Logarithmic Derivative Calculator.
- How to differentiate two functions multiplied together, covered in the Product Rule Calculator.
- How to differentiate a function inside another function, covered in the Chain Rule Calculator.
Where Is Logarithmic Differentiation Used?
Logarithmic differentiation takes the natural log of both sides before differentiating, which turns products, quotients and powers into sums and differences. It is the standard method for functions with a variable in both the base and the exponent, like \(x^x\), which no other basic rule can handle. It also simplifies derivatives of long products and quotients, such as formulas in physics, chemistry and economics with many multiplied factors. Economists use the same idea to find growth rates and elasticities from models built on multiplication.
- Differentiating functions like \(x^x\) and \(x^{\sin x}\)
- Simplifying derivatives of long products and quotients
- Finding growth rates in economic models
- Working with multiplied factors in physics formulas
- Checking derivatives found with the product and quotient rules
Logarithmic Differentiation Practice Problems
Example 1 differentiates \(y = x^x\), and Example 2 differentiates \(y = x^{\sin x}\). Examples 3 and 4 give you two more of the same kind to try, \(y = \left(x^{2} + 1\right)^{x}\) and \(y = \left(\ln\left(x\right)\right)^{x}\). Try taking logs of both sides yourself before opening each example.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the logarithmic differentiation formula.
- Take the natural log of both sides.
- Differentiate both sides, as Step 4a, Step 4b and Step 4c.
- Multiply both sides by y and put y back.
Formula
Formula: Logarithmic Differentiation
For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.
Step 1
Step 1 - Set up the problem.
In this problem: Both the base \(x\) and the power \(x\) contain \(x\), so neither the power rule nor the exponential rule works on its own. Taking the natural log of both sides brings the power down.
Step 2
Step 2 - Write the logarithmic differentiation formula.
In this problem: Take ln of both sides, differentiate, then multiply back by the original function.
Step 3
Step 3 - Take the natural log of both sides.
In this problem: The log rule \(\ln\left(a^{b}\right) = b \ln(a)\) brings the power down in front of the log.
Step 4
Step 4 - Differentiate both sides, as Step 4a, Step 4b and Step 4c.
In this problem: Differentiate the left side and the right side separately.
Step 4a
Step 4a - Differentiate the left side.
In this problem: y depends on \(x\), so by the chain rule the derivative of \(\ln y\) is \(\frac{1}{y}\) times \(\frac{dy}{dx}\).
Step 4b
Step 4b - Differentiate the right side.
In this problem: The right side is \(x \ln\left(x\right)\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the product rule formula.
- Differentiate the first factor.
- Differentiate the second factor.
- Substitute into the product rule formula.
- Simplify the result.
Step 1
Step 1 - Set up the two factors f(x) and g(x).
In this problem: The first factor is \(x\) and the second factor is \(\ln\left(x\right)\).
Step 2
Step 2 - Write the product rule formula.
In this problem: The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.
Step 3
Step 3 - Differentiate the first factor.
In this problem: Differentiate \(x\) to get \(1\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the variable rule formula.
- Apply the variable rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x\). This is just the variable \(x\).
Step 2
Step 2 - Write the variable rule formula.
In this problem: The variable rule says the derivative of \(x\) with respect to \(x\) is \(1\).
Step 3
Step 3 - Apply the variable rule.
In this problem: Put \(x\) into the rule from Step 2, so its derivative is \(1\).
Final Answer
Step 4
Step 4 - Differentiate the second factor.
In this problem: Differentiate \(\ln\left(x\right)\) to get \(\frac{1}{x}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for the natural logarithm.
- Apply the derivative rule.
Step 1
Step 1 - Identify the logarithmic function and any constant multiple.
In this problem: The function is \(\ln\left(x\right)\).
Step 2
Step 2 - Write the derivative rule for the natural logarithm.
In this problem: The derivative of the natural logarithm is one over x.
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\ln\left(x\right)\) into the rule from Step 2.
Final Answer
Step 5
Step 5 - Substitute into the product rule formula.
In this problem: Substitute the factors and their derivatives into the formula.
Step 6
Step 6 - Simplify the result.
In this problem: Expand the products and combine like terms.
Final Answer
Step 4c
Step 4c - Put both sides back together.
In this problem: The two derivatives are equal, because the two sides were equal.
Step 5
Step 5 - Multiply both sides by y and put y back.
In this problem: Multiplying both sides by y leaves \(\frac{dy}{dx}\) on its own. Then y is replaced with \(x^{x}\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the logarithmic differentiation formula.
- Take the natural log of both sides.
- Differentiate both sides, as Step 4a, Step 4b and Step 4c.
- Multiply both sides by y and put y back.
Formula
Formula: Logarithmic Differentiation
For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.
Step 1
Step 1 - Set up the problem.
In this problem: Both the base \(x\) and the power \(\sin{\left(x \right)}\) contain \(x\), so neither the power rule nor the exponential rule works on its own. Taking the natural log of both sides brings the power down.
Step 2
Step 2 - Write the logarithmic differentiation formula.
In this problem: Take ln of both sides, differentiate, then multiply back by the original function.
Step 3
Step 3 - Take the natural log of both sides.
In this problem: The log rule \(\ln\left(a^{b}\right) = b \ln(a)\) brings the power down in front of the log.
Step 4
Step 4 - Differentiate both sides, as Step 4a, Step 4b and Step 4c.
In this problem: Differentiate the left side and the right side separately.
Step 4a
Step 4a - Differentiate the left side.
In this problem: y depends on \(x\), so by the chain rule the derivative of \(\ln y\) is \(\frac{1}{y}\) times \(\frac{dy}{dx}\).
Step 4b
Step 4b - Differentiate the right side.
In this problem: The right side is \(\ln\left(x\right) \sin{\left(x \right)}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the product rule formula.
- Differentiate the first factor.
- Differentiate the second factor.
- Substitute into the product rule formula.
- Simplify the result.
Step 1
Step 1 - Set up the two factors f(x) and g(x).
In this problem: The first factor is \(\ln\left(x\right)\) and the second factor is \(\sin{\left(x \right)}\).
Step 2
Step 2 - Write the product rule formula.
In this problem: The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.
Step 3
Step 3 - Differentiate the first factor.
In this problem: Differentiate \(\ln\left(x\right)\) to get \(\frac{1}{x}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for the natural logarithm.
- Apply the derivative rule.
Step 1
Step 1 - Identify the logarithmic function and any constant multiple.
In this problem: The function is \(\ln\left(x\right)\).
Step 2
Step 2 - Write the derivative rule for the natural logarithm.
In this problem: The derivative of the natural logarithm is one over x.
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\ln\left(x\right)\) into the rule from Step 2.
Final Answer
Step 4
Step 4 - Differentiate the second factor.
In this problem: Differentiate \(\sin{\left(x \right)}\) to get \(\cos{\left(x \right)}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for that trigonometric function.
- Apply the derivative rule.
Step 1
Step 1 - Identify the trigonometric function and any constant multiple.
In this problem: The function is \(\sin{\left(x \right)}\).
Step 2
Step 2 - Write the derivative rule for that trigonometric function.
In this problem: The derivative of \(\sin{\left(x \right)}\) is \(\cos{\left(x \right)}\).
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\sin{\left(x \right)}\) into the rule from Step 2.
Final Answer
Step 5
Step 5 - Substitute into the product rule formula.
In this problem: Substitute the factors and their derivatives into the formula.
Step 6
Step 6 - Simplify the result.
In this problem: Expand the products and combine like terms.
Final Answer
Step 4c
Step 4c - Put both sides back together.
In this problem: The two derivatives are equal, because the two sides were equal.
Step 5
Step 5 - Multiply both sides by y and put y back.
In this problem: Multiplying both sides by y leaves \(\frac{dy}{dx}\) on its own. Then y is replaced with \(x^{\sin{\left(x \right)}}\).
Final Answer
See Example 3 Hide Example 3
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the logarithmic differentiation formula.
- Take the natural log of both sides.
- Differentiate both sides, as Step 4a, Step 4b and Step 4c.
- Multiply both sides by y and put y back.
Formula
Formula: Logarithmic Differentiation
For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.
Step 1
Step 1 - Set up the problem.
In this problem: Both the base \(x^{2} + 1\) and the power \(x\) contain \(x\), so neither the power rule nor the exponential rule works on its own. Taking the natural log of both sides brings the power down.
Step 2
Step 2 - Write the logarithmic differentiation formula.
In this problem: Take ln of both sides, differentiate, then multiply back by the original function.
Step 3
Step 3 - Take the natural log of both sides.
In this problem: The log rule \(\ln\left(a^{b}\right) = b \ln(a)\) brings the power down in front of the log.
Step 4
Step 4 - Differentiate both sides, as Step 4a, Step 4b and Step 4c.
In this problem: Differentiate the left side and the right side separately.
Step 4a
Step 4a - Differentiate the left side.
In this problem: y depends on \(x\), so by the chain rule the derivative of \(\ln y\) is \(\frac{1}{y}\) times \(\frac{dy}{dx}\).
Step 4b
Step 4b - Differentiate the right side.
In this problem: The right side is \(x \ln\left(x^{2} + 1\right)\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the product rule formula.
- Differentiate the first factor.
- Differentiate the second factor.
- Substitute into the product rule formula.
- Simplify the result.
Step 1
Step 1 - Set up the two factors f(x) and g(x).
In this problem: The first factor is \(x\) and the second factor is \(\ln\left(x^{2} + 1\right)\).
Step 2
Step 2 - Write the product rule formula.
In this problem: The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.
Step 3
Step 3 - Differentiate the first factor.
In this problem: Differentiate \(x\) to get \(1\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the variable rule formula.
- Apply the variable rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x\). This is just the variable \(x\).
Step 2
Step 2 - Write the variable rule formula.
In this problem: The variable rule says the derivative of \(x\) with respect to \(x\) is \(1\).
Step 3
Step 3 - Apply the variable rule.
In this problem: Put \(x\) into the rule from Step 2, so its derivative is \(1\).
Final Answer
Step 4
Step 4 - Differentiate the second factor.
In this problem: Differentiate \(\ln\left(x^{2} + 1\right)\) to get \(\frac{2 x}{x^{2} + 1}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the chain rule formula.
- Differentiate the outer function with respect to u.
- Differentiate the inner function with respect to the variable.
- Multiply the derivatives and substitute u back.
Step 1
Step 1 - Identify the inner function u and the outer function.
In this problem: The inner function is \(u = x^{2} + 1\) and the outer function is \(\ln\left(u\right)\).
Step 2
Step 2 - Write the chain rule formula.
In this problem: Differentiate the outer function with respect to u, then multiply by the derivative of the inner function.
Step 3
Step 3 - Differentiate the outer function with respect to u.
In this problem: Treat u as the variable: the derivative of \(\ln\left(u\right)\) is \(\frac{1}{u}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for the natural logarithm.
- Apply the derivative rule.
Step 1
Step 1 - Identify the logarithmic function and any constant multiple.
In this problem: The function is \(\ln\left(u\right)\).
Step 2
Step 2 - Write the derivative rule for the natural logarithm.
In this problem: The derivative of the natural logarithm is one over u.
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\ln\left(u\right)\) into the rule from Step 2.
Final Answer
Step 4
Step 4 - Differentiate the inner function with respect to the variable.
In this problem: The derivative of \(x^{2} + 1\) is \(2 x\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the sum rule formula.
- Split the derivative across the addition signs.
- Differentiate each separated term as Step 4a, Step 4b, Step 4c, and so on.
- Combine the term derivatives and simplify.
Step 1
Step 1 - Set up the terms in the sum.
In this problem: We are given a sum. The separate terms are \(x^{2}\), \(1\).
Step 2
Step 2 - Write the sum rule formula.
In this problem: The sum rule says the derivative of a sum is the sum of the derivatives.
Step 3
Step 3 - Split the derivative across the addition signs.
In this problem: Apply the derivative to each separated term.
Step 4a
Step 4a - Differentiate the separated term \(x^{2}\).
In this problem: The separated term is \(x^{2}\). Use the power rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the power rule formula.
- Substitute the exponent into the power rule.
- Solve and simplify.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x^{2}\). This is a power of \(x\), so the exponent is \(n = 2\).
Step 2
Step 2 - Write the power rule formula.
In this problem: The power rule says to move the exponent to the front, then subtract 1 from the exponent.
Step 3
Step 3 - Substitute the given power into the formula.
In this problem: Here, \(n = 2\). Substitute this exponent into the power rule, but do not simplify yet.
Step 4
Step 4 - Solve and simplify.
In this problem: Now subtract 1 from the exponent. This gives \(2{x}^{1}\).
Final Answer
Step 4b
Step 4b - Differentiate the separated term \(1\).
In this problem: The separated term is \(1\). Use the constant rule to get its derivative.
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the constant rule formula.
- Apply the constant rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(1\). This expression does not contain \(x\), so it is a constant.
Step 2
Step 2 - Write the constant rule formula.
In this problem: The constant rule says the derivative of any constant is \(0\).
Step 3
Step 3 - Apply the constant rule.
In this problem: Since \(1\) is constant, its derivative is \(0\).
Final Answer
Step 5
Step 5 - Combine and simplify.
In this problem: Combine the derivative from each separated term, then simplify the result.
Final Answer
Step 5
Step 5 - Multiply the derivatives and substitute u back.
In this problem: Multiply the two derivatives and replace u with \(x^{2} + 1\), then simplify.
Final Answer
Step 5
Step 5 - Substitute into the product rule formula.
In this problem: Substitute the factors and their derivatives into the formula.
Step 6
Step 6 - Simplify the result.
In this problem: Expand the products and combine like terms.
Final Answer
Step 4c
Step 4c - Put both sides back together.
In this problem: The two derivatives are equal, because the two sides were equal.
Step 5
Step 5 - Multiply both sides by y and put y back.
In this problem: Multiplying both sides by y leaves \(\frac{dy}{dx}\) on its own. Then y is replaced with \(\left(x^{2} + 1\right)^{x}\).
Final Answer
See Example 4 Hide Example 4
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the logarithmic differentiation formula.
- Take the natural log of both sides.
- Differentiate both sides, as Step 4a, Step 4b and Step 4c.
- Multiply both sides by y and put y back.
Formula
Formula: Logarithmic Differentiation
For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.
Step 1
Step 1 - Set up the problem.
In this problem: Both the base \(\ln\left(x\right)\) and the power \(x\) contain \(x\), so neither the power rule nor the exponential rule works on its own. Taking the natural log of both sides brings the power down.
Step 2
Step 2 - Write the logarithmic differentiation formula.
In this problem: Take ln of both sides, differentiate, then multiply back by the original function.
Step 3
Step 3 - Take the natural log of both sides.
In this problem: The log rule \(\ln\left(a^{b}\right) = b \ln(a)\) brings the power down in front of the log.
Step 4
Step 4 - Differentiate both sides, as Step 4a, Step 4b and Step 4c.
In this problem: Differentiate the left side and the right side separately.
Step 4a
Step 4a - Differentiate the left side.
In this problem: y depends on \(x\), so by the chain rule the derivative of \(\ln y\) is \(\frac{1}{y}\) times \(\frac{dy}{dx}\).
Step 4b
Step 4b - Differentiate the right side.
In this problem: The right side is \(x \ln\left(\ln\left(x\right)\right)\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the product rule formula.
- Differentiate the first factor.
- Differentiate the second factor.
- Substitute into the product rule formula.
- Simplify the result.
Step 1
Step 1 - Set up the two factors f(x) and g(x).
In this problem: The first factor is \(x\) and the second factor is \(\ln\left(\ln\left(x\right)\right)\).
Step 2
Step 2 - Write the product rule formula.
In this problem: The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.
Step 3
Step 3 - Differentiate the first factor.
In this problem: Differentiate \(x\) to get \(1\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the variable rule formula.
- Apply the variable rule.
Step 1
Step 1 - Set up the problem.
In this problem: We are given \(x\). This is just the variable \(x\).
Step 2
Step 2 - Write the variable rule formula.
In this problem: The variable rule says the derivative of \(x\) with respect to \(x\) is \(1\).
Step 3
Step 3 - Apply the variable rule.
In this problem: Put \(x\) into the rule from Step 2, so its derivative is \(1\).
Final Answer
Step 4
Step 4 - Differentiate the second factor.
In this problem: Differentiate \(\ln\left(\ln\left(x\right)\right)\) to get \(\frac{1}{x \ln\left(x\right)}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the chain rule formula.
- Differentiate the outer function with respect to u.
- Differentiate the inner function with respect to the variable.
- Multiply the derivatives and substitute u back.
Step 1
Step 1 - Identify the inner function u and the outer function.
In this problem: The inner function is \(u = \ln\left(x\right)\) and the outer function is \(\ln\left(u\right)\).
Step 2
Step 2 - Write the chain rule formula.
In this problem: Differentiate the outer function with respect to u, then multiply by the derivative of the inner function.
Step 3
Step 3 - Differentiate the outer function with respect to u.
In this problem: Treat u as the variable: the derivative of \(\ln\left(u\right)\) is \(\frac{1}{u}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for the natural logarithm.
- Apply the derivative rule.
Step 1
Step 1 - Identify the logarithmic function and any constant multiple.
In this problem: The function is \(\ln\left(u\right)\).
Step 2
Step 2 - Write the derivative rule for the natural logarithm.
In this problem: The derivative of the natural logarithm is one over u.
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\ln\left(u\right)\) into the rule from Step 2.
Final Answer
Step 4
Step 4 - Differentiate the inner function with respect to the variable.
In this problem: The derivative of \(\ln\left(x\right)\) is \(\frac{1}{x}\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the derivative rule for the natural logarithm.
- Apply the derivative rule.
Step 1
Step 1 - Identify the logarithmic function and any constant multiple.
In this problem: The function is \(\ln\left(x\right)\).
Step 2
Step 2 - Write the derivative rule for the natural logarithm.
In this problem: The derivative of the natural logarithm is one over x.
Step 3
Step 3 - Apply the derivative rule.
In this problem: Put \(\ln\left(x\right)\) into the rule from Step 2.
Final Answer
Step 5
Step 5 - Multiply the derivatives and substitute u back.
In this problem: Multiply the two derivatives and replace u with \(\ln\left(x\right)\), then simplify.
Final Answer
Step 5
Step 5 - Substitute into the product rule formula.
In this problem: Substitute the factors and their derivatives into the formula.
Step 6
Step 6 - Simplify the result.
In this problem: Expand the products and combine like terms.
Final Answer
Step 4c
Step 4c - Put both sides back together.
In this problem: The two derivatives are equal, because the two sides were equal.
Step 5
Step 5 - Multiply both sides by y and put y back.
In this problem: Multiplying both sides by y leaves \(\frac{dy}{dx}\) on its own. Then y is replaced with \(\left(\ln\left(x\right)\right)^{x}\).
Final Answer
Calculator and Practice Mode
Want to check your own working? The Logarithmic Differentiation Calculator solves any problem you type in and shows every step, so you can compare it line by line with your answer and find exactly where a mistake crept in. When you are ready to test yourself, Logarithmic Differentiation Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode is available on the Plus and Pro plans.