Derivative of xˣ: Formula, Proof and Examples
The derivative of xˣ is xˣ(ln x + 1). Learn two methods, logarithmic differentiation and rewriting as e^(x ln x), plus a graph and examples.
Exponential and log derivatives Updated 2 min read
At a glance
- Derivative
- x^x(\ln x + 1) for x > 0
- Key rewrite
- x^x = e^{x\ln x}
- Method
- logarithmic differentiation
- Minimum
- x = \frac{1}{e}, value e^{-1/e} \approx 0.692
- General form
- \dfrac{d}{dx}f^g = f^g\left(g'\ln f + \dfrac{gf'}{f}\right)
On this page
The derivative of x^x is x^x(\ln x + 1). It is the classic example of a function that needs logarithmic differentiation.
Why the usual rules fail
| Function | Base | Exponent | Rule | Derivative |
|---|---|---|---|---|
| x^3 | variable | constant | power rule | 3x^2 |
| 3^x | constant | variable | exponential rule | 3^x\ln 3 |
| x^x | variable | variable | neither alone | x^x(\ln x + 1) |
Applying the power rule gives x\cdot x^{x-1} = x^x, and applying the exponential rule gives x^x\ln x. Both are wrong. Interestingly, the correct answer is their sum.
Method 1: logarithmic differentiation
Let y = x^x. Take the natural log of both sides to bring the exponent down:
Differentiate both sides. The left side needs implicit differentiation, and the right side needs the product rule (it is the derivative of x ln x):
Multiply by y = x^x:
Method 2: rewrite with base e
Since x = e^{\ln x}, we have x^x = e^{x\ln x}. Now use the chain rule with outer function e^u:
Both methods are really the same idea. Use whichever feels more natural.
Graph of xˣ and its derivative
Since x^x > 0, the sign of the derivative depends only on \ln x + 1. It is negative for x < \frac{1}{e} and positive after, so the minimum is at x = \frac{1}{e}. Its value is \left(e^{-1}\right)^{1/e} = e^{-1/e} \approx 0.692.
Worked examples
Example 1: slope at x = 2. \frac{d}{dx}x^x\big|_{x = 2} = 2^2(\ln 2 + 1) = 4(1.693) \approx 6.77.
Example 2: x to the sin x. Let y = x^{\sin x}. Then \ln y = \sin x\ln x, and
Example 3: x to the 1/x. Let y = x^{1/x}. Then \ln y = \frac{\ln x}{x}, and the quotient rule gives
This is zero at x = e, so x^{1/x} is largest at x = e, with value e^{1/e} \approx 1.445.
Example 4: x to the x squared. For y = x^{x^2}, \ln y = x^2\ln x, so y' = x^{x^2}(2x\ln x + x).
Common mistakes
- Power rule: x\cdot x^{x-1} = x^x. Wrong, because the exponent is not constant.
- Exponential rule: x^x\ln x. Wrong, because the base is not constant.
- Forgetting to multiply by y at the end of logarithmic differentiation, leaving just \ln x + 1.
For more on this method, see implicit differentiation problems and the derivative of 2ˣ and aˣ.
Practice it now
Implicit differentiation
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson