# 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.

Source: https://practicecalculus.com/derivatives/x-to-the-x
Updated: 2026-11-06

$$ \frac{d}{dx}\,x^x = x^x(\ln x + 1) $$

## 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)$

## Key takeaways

- The derivative of $x^x$ is $x^x(\ln x + 1)$.
- Neither the power rule nor the exponential rule works, because both the base and the exponent change.
- Take $\ln$ of both sides (logarithmic differentiation), or rewrite $x^x = e^{x\ln x}$ and use the chain rule.
- The graph has a minimum at $x = \frac{1}{e}$, where $\ln x + 1 = 0$.

The **derivative of $x^x$ is $x^x(\ln x + 1)$**. It is the classic example of a function that needs [logarithmic differentiation](/rules/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](/rules/implicit-differentiation), and the right side needs the product rule (it is the [derivative of x ln x](/derivatives/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](/rules/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
title: 'Graph of y = xˣ and its derivative'
caption: '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$.'
x: [-0.2, 2.2]
y: [-1.5, 6]
functions:
  - expr: x^x
    label: y = xˣ
    domain: [0.01, 2.1]
  - expr: x^x*(ln(x) + 1)
    label: y = xˣ(ln x + 1) (derivative)
    dashed: true
    domain: [0.08, 1.75]
points:
  - [0.3679, 0.6922, 'minimum (1/e, 0.692)']
  - [1, 1, '(1, 1), slope 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](/practice-problems/implicit-differentiation) and the [derivative of 2ˣ and aˣ](/derivatives/2-to-the-x).

## 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$.
