Derivative of x to the x: Logarithmic Differentiation
The derivative of x to the x is one of the first derivatives that resists every rule you have already learned. Neither the power rule nor the exponential rule applies to on its own, because both the base and the exponent are the variable x. The way through is logarithmic differentiation: take the natural log of both sides, differentiate implicitly, and solve for the derivative. This post walks through why the usual rules fail and works two examples, including , step by step.

Key takeaways
- The power rule needs a constant exponent, and the exponential rule needs a constant base, so neither one applies to on its own.
- Logarithmic differentiation solves this by taking the natural log of both sides first, which turns the exponent into a multiplied term instead of a power.
- The derivative of is .
- The same method extends to any function of the form , including .
- Differentiating implicitly after taking the log requires the product rule, since the exponent and are both functions of x.
Why the power rule and the exponential rule both fail here
The power rule states that , but this only holds when n is a constant, a fixed number that does not change with x. In , the exponent is x, not a fixed number, so treating it as one and writing gives the wrong derivative.
The exponential rule states that , but this only holds when a is a constant base. In , the base is also x, not a fixed number, so this rule does not apply either.
has a variable in both positions at once, which neither rule was built to handle. What is needed is a method that can treat the base and the exponent as two functions of x at the same time, and that is exactly what logarithmic differentiation does.Logarithmic differentiation: turn the exponent into a multiplier
Taking the natural log of both sides of uses one property of logarithms: . This moves the exponent down in front, turning a power into a product, which the product rule can handle directly.
- Start with the original function.
- Take the natural log of both sides.
- Apply the log power rule to bring the exponent down as a multiplier.
- Differentiate both sides with respect to x. The left side needs the chain rule, since y is a function of x, and the right side needs the product rule, since both x and depend on x.
- Simplify the right side.
- Solve for by multiplying both sides by y.
- Substitute the original function, , back in, since the derivative should be in terms of x alone.
That last substitution matters: without it, the answer is left in terms of y, which is not a valid final derivative.
Worked examples
Example 1: derivative of
- Take the natural log of both sides of .
- Differentiate both sides, using the chain rule on the left and the product rule on the right.
- Solve for and substitute back in.
So . Check it at : the formula gives , so the slope of at should be exactly 1, which is a clean, checkable point.
Example 2: derivative of
- Take the natural log of both sides of .
- Differentiate both sides. The left side again needs the chain rule, and the right side needs the product rule on and .
- Solve for and substitute back in.
So . Check it at : the formula gives , matching the pattern set by Example 1, since doubling the exponent doubles the derivative at this point.
Common mistakes
- Applying the power rule directly to , which only works when the exponent is a fixed constant.
- Applying the exponential rule directly to , which only works when the base is a fixed constant.
- Forgetting the chain rule on the left side after taking the log of y, since y is itself a function of x, not a plain variable.
- Leaving the final answer in terms of y instead of substituting the original function back in at the last step.
- Missing the product rule when differentiating a term like or on the right side.
To see the broader set of rules this fits into, start with How to Do Derivatives: Rules, Examples and Checks. Logarithmic differentiation is one tool among several: for a derivative found straight from the definition, see Using the Definition of the Derivative: Limit Method, and for two other rule-based derivatives, see Derivative of 1/t and Other Reciprocals, Step by Step and Derivative of -sin x and the Other Trig Derivatives. If you want to check a derivative of your own line by line, scan the problem and read every step in AI Math Tutor.
AI Math Tutor is a study aid, not a substitute for a teacher, and it can make mistakes: check every step, not just the answer.
Questions
Why can't you use the power rule on x to the x?
The power rule, , only works when the exponent n is a fixed constant. In the exponent is x itself, which changes along with the base, so the power rule does not apply.
What is logarithmic differentiation?
Logarithmic differentiation is a technique for differentiating a function where the variable appears in both the base and the exponent. You take the natural log of both sides, which turns the exponent into a multiplied term, then differentiate both sides implicitly and solve for the derivative.
Is the derivative of x to the x the same as x times x to the x minus 1?
No. That expression comes from applying the power rule as though the exponent were a constant, which it is not in . The correct derivative is , found through logarithmic differentiation.
Does logarithmic differentiation work for any variable base and exponent?
Yes. Any function of the form , where both the base and the exponent depend on x, can be differentiated this way: take the natural log of both sides, differentiate implicitly using the product rule, then solve for the derivative and substitute the original function back in.
How to differentiate x to the power x?
Differentiate x to the power x with logarithmic differentiation, and the result is . Set , take the natural log of both sides to get , then differentiate both sides using the product rule. Multiply through by y and substitute back in.