practicecalculus
Exponential and log derivatives

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

\frac{d}{dx}\,x^x = x^x(\ln x + 1)
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
  1. Why the usual rules fail
  2. Method 1: logarithmic differentiation
  3. Method 2: rewrite with base e
  4. Graph of xˣ and its derivative
  5. Worked examples
  6. Common mistakes

The derivative of x^x is x^x(\ln x + 1). It is the classic example of a function that needs logarithmic differentiation.

\frac{d}{dx}\,x^x = x^x(\ln x + 1), \qquad x > 0

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:

\ln y = x\ln x

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):

\frac{1}{y}\cdot\frac{dy}{dx} = \ln x + 1

Multiply by y = x^x:

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

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:

\frac{d}{dx}e^{x\ln x} = e^{x\ln x}\cdot\frac{d}{dx}(x\ln x) = x^x(\ln x + 1)

Both methods are really the same idea. Use whichever feels more natural.

Graph of xˣ and its derivative

Graph of y = xˣ and its derivative
The curve dips to its lowest value of about 0.692 at x = \frac{1}{e}, then grows very quickly. At x = 1 both the value and the slope equal 1.

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

\frac{y'}{y} = \cos x\ln x + \frac{\sin x}{x} \quad\Longrightarrow\quad y' = x^{\sin x}\left(\cos x\ln x + \frac{\sin x}{x}\right)

Example 3: x to the 1/x. Let y = x^{1/x}. Then \ln y = \frac{\ln x}{x}, and the quotient rule gives

\frac{y'}{y} = \frac{1 - \ln x}{x^2} \quad\Longrightarrow\quad y' = x^{1/x}\cdot\frac{1 - \ln x}{x^2}

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

  1. Power rule: x\cdot x^{x-1} = x^x. Wrong, because the exponent is not constant.
  2. Exponential rule: x^x\ln x. Wrong, because the base is not constant.
  3. 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

Frequently asked questions

What is the derivative of x^x?

The derivative of x^x is x^x(\ln x + 1), for x > 0.

Why can I not use the power rule on x^x?

The power rule needs a constant exponent, and the exponential rule needs a constant base. In x^x both change, so you have to use logarithmic differentiation or rewrite it as e^{x\ln x}.

What is the derivative of x^(sin x)?

With logarithmic differentiation: x^{\sin x}\left(\cos x\ln x + \frac{\sin x}{x}\right).

Where is the minimum of x^x?

At x = \frac{1}{e} \approx 0.368, where the derivative is zero. The minimum value is \left(\frac{1}{e}\right)^{1/e} = e^{-1/e} \approx 0.692.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.