Logarithmic Differentiation Calculator

Published on: November 23, 2026
Final Answer: Free | Full Steps: Plus

This Logarithmic Differentiation Calculator differentiates a power whose base and exponent both contain x, such as x to the x, and shows the working 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

  1. Set up the problem.
  2. Write the logarithmic differentiation formula.
  3. Take the natural log of both sides.
  4. Differentiate both sides, as Step 4a, Step 4b and Step 4c.
  5. 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.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

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

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}\). Try taking logs of both sides yourself before opening each example. For two more free worked examples, check out the Logarithmic Differentiation Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(y = x^{x}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the logarithmic differentiation formula.
  3. Take the natural log of both sides.
  4. Differentiate both sides, as Step 4a, Step 4b and Step 4c.
  5. 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.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

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.

\(y = x^{x}\)

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.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

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.

\(\ln y = \ln\left(x^{x}\right) = x \ln\left(x\right)\)

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.

\(\frac{d}{dx}\left(\ln y\right) = \frac{d}{dx}\left(x \ln\left(x\right)\right)\)

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}\).

\(\frac{d}{dx}\left(\ln y\right) = \frac{1}{y} \frac{dy}{dx}\)

Step 4b

Step 4b - Differentiate the right side.

In this problem: The right side is \(x \ln\left(x\right)\).

\(\frac{d}{dx}\left(x \ln\left(x\right)\right) = \ln\left(x\right) + 1\)

Step 4c

Step 4c - Put both sides back together.

In this problem: The two derivatives are equal, because the two sides were equal.

\(\frac{1}{y} \frac{dy}{dx} = \ln\left(x\right) + 1\)

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}\).

\(\frac{dy}{dx} = y\left(\ln\left(x\right) + 1\right) = x^{x}\left(\ln\left(x\right) + 1\right)\)

Final Answer

\(\frac{dy}{dx} = x^{x}\left(\ln\left(x\right) + 1\right)\)
See Example 2 Hide Example 2

Problem

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

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the logarithmic differentiation formula.
  3. Take the natural log of both sides.
  4. Differentiate both sides, as Step 4a, Step 4b and Step 4c.
  5. 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.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

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.

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

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.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

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.

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

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.

\(\frac{d}{dx}\left(\ln y\right) = \frac{d}{dx}\left(\ln\left(x\right) \sin{\left(x \right)}\right)\)

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}\).

\(\frac{d}{dx}\left(\ln y\right) = \frac{1}{y} \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)}\).

\(\frac{d}{dx}\left(\ln\left(x\right) \sin{\left(x \right)}\right) = \ln\left(x\right) \cos{\left(x \right)} + \frac{\sin{\left(x \right)}}{x}\)

Step 4c

Step 4c - Put both sides back together.

In this problem: The two derivatives are equal, because the two sides were equal.

\(\frac{1}{y} \frac{dy}{dx} = \ln\left(x\right) \cos{\left(x \right)} + \frac{\sin{\left(x \right)}}{x}\)

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)}}\).

\(\frac{dy}{dx} = y\left(\ln\left(x\right) \cos{\left(x \right)} + \frac{\sin{\left(x \right)}}{x}\right) = x^{\sin{\left(x \right)}}\left(\ln\left(x\right) \cos{\left(x \right)} + \frac{\sin{\left(x \right)}}{x}\right)\)

Final Answer

\(\frac{dy}{dx} = x^{\sin{\left(x \right)}}\left(\ln\left(x\right) \cos{\left(x \right)} + \frac{\sin{\left(x \right)}}{x}\right)\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.