AP Calculus AB and BC

Derivative of x^x: Answer, Proof, and Mistakes

The derivative of x^x is x^x(ln x + 1), valid for x > 0. Because x^x has the variable in both the base and the exponent, neither the power rule nor the exponential rule works alone. Taking the natural log of both sides and differentiating implicitly (logarithmic differentiation) gives the result.

ddx[xx]=xx(lnx+1)\frac{d}{dx}\left[x^x\right] = x^x(\ln x + 1)

Why neither the power rule nor the exponential rule works

The function xxx^x puts the variable in two places at once: it is both the base and the exponent. Every basic derivative rule assumes one of those two is a fixed number, so no single rule applies here.

The power rule ddx[xn]=nxn1\frac{d}{dx}\left[x^n\right] = n\,x^{n-1} needs the exponent nn to be constant, but in xxx^x the exponent is the variable xx. The exponential rule ddx[ax]=axlna\frac{d}{dx}\left[a^x\right] = a^x \ln a needs the base aa to be constant, but in xxx^x the base is also the variable xx. Each rule breaks on the part the other one handles.

The two wrong answers add up to the right one

Force the power rule and you get xxx1=xxx \cdot x^{x-1} = x^x. Force the exponential rule and you get xxlnxx^x \ln x. The correct derivative xx(lnx+1)x^x(\ln x + 1) is exactly the sum of those two wrong answers. That is a useful way to remember the result, and the proof below shows why it happens.

Proof by logarithmic differentiation

Since no single rule fits, take the natural log of both sides first. That turns the stubborn exponent into a product, which the product rule can handle. This technique is called logarithmic differentiation. Start by naming the function y=xxy = x^x and applying ln\ln to both sides.

y=xxlny=ln(xx)=xlnxy = x^x \quad\Longrightarrow\quad \ln y = \ln\left(x^x\right) = x \ln x

Differentiate both sides with respect to xx. The left side needs the chain rule because yy is a function of xx, and the right side xlnxx \ln x needs the product rule.

1ydydx=(1)lnx+x1x=lnx+1\frac{1}{y}\cdot\frac{dy}{dx} = (1)\cdot\ln x + x\cdot\frac{1}{x} = \ln x + 1

Solve for dydx\frac{dy}{dx} by multiplying both sides by yy, then replace yy with xxx^x.

dydx=y(lnx+1)=xx(lnx+1)\frac{dy}{dx} = y(\ln x + 1) = x^x(\ln x + 1)

Domain: x must be positive

As a continuous real function, xx=exlnxx^x = e^{x \ln x}, and that lnx\ln x forces x>0x > 0. The same lnx\ln x shows up in the proof step lny=xlnx\ln y = x \ln x, so both the function and this method require positive xx. The derivative xx(lnx+1)x^x(\ln x + 1) holds on that same domain, and there is no real derivative at x0x \le 0.

Where this shows up on the AP exam

You rarely see xxx^x named directly on the AP exam, but every move in its derivative is a tested skill. The lnx\ln x derivative in the middle step is Topic 2.7 (Derivatives of cosx\cos x, sinx\sin x, exe^x, and lnx\ln x). Differentiating lny\ln y as a function of xx is implicit differentiation, Topic 3.2, and the factor dydx\frac{dy}{dx} it produces comes from the chain rule, Topic 3.1.

The larger skill is noticing that a standard rule does not fit and choosing a different route, which is exactly Topic 3.5, Selecting Procedures for Calculating Derivatives. A function with a variable in both the base and the exponent is the signal to reach for logarithmic differentiation instead of the power or exponential rule.

Common mistakes

  • Using the power rule and writing xxx1=xxx \cdot x^{x-1} = x^x. That treats the exponent as constant and drops the entire lnx\ln x term.
  • Using the exponential rule and writing xxlnxx^x \ln x. That treats the base as constant and drops the +1+1.
  • Forgetting the chain rule on the left side: writing ddx[lny]=1y\frac{d}{dx}\left[\ln y\right] = \frac{1}{y} instead of 1ydydx\frac{1}{y}\cdot\frac{dy}{dx}. Without that dydx\frac{dy}{dx} factor you can never solve for the derivative.
  • Reporting the answer for every xx. As a continuous real function, xxx^x and its derivative exist only for x>0x > 0.
  • In a composite such as exxe^{x^x} or (xx)2\left(x^x\right)^2, forgetting to multiply by the inner derivative xx(lnx+1)x^x(\ln x + 1).

Quick chain-rule composites

Once you have ddx[xx]=xx(lnx+1)\frac{d}{dx}\left[x^x\right] = x^x(\ln x + 1), it becomes the inner piece of any composite. Here are two.

Composite 1: differentiate exxe^{x^x}. The outer function is eue^u with u=xxu = x^x, so the chain rule gives eue^u times the derivative of the inside.

ddx[exx]=exxddx[xx]=exxxx(lnx+1)\frac{d}{dx}\left[e^{x^x}\right] = e^{x^x}\cdot\frac{d}{dx}\left[x^x\right] = e^{x^x}\cdot x^x(\ln x + 1)

Composite 2: differentiate ln(xx)\ln\left(x^x\right) as a self-check. By the chain rule it is 1xx\frac{1}{x^x} times the derivative of xxx^x.

ddx[ln(xx)]=1xxxx(lnx+1)=lnx+1\frac{d}{dx}\left[\ln\left(x^x\right)\right] = \frac{1}{x^x}\cdot x^x(\ln x + 1) = \ln x + 1

Because ln(xx)=xlnx\ln\left(x^x\right) = x \ln x, differentiating directly with the product rule also gives lnx+1\ln x + 1. The two routes agree, which confirms the derivative of xxx^x. As a numeric anchor, at x=1x = 1 the slope is 11(ln1+1)=11^1(\ln 1 + 1) = 1, so y=xxy = x^x passes through (1,1)(1, 1) with slope 11.

Check yourself, not just the answer

Type derivatives and get graded on mathematical equivalence, with rule-level hints when you miss, in the Derivative Practice Checker.

Frequently asked questions

What is the derivative of x^x?

It is xx(lnx+1)x^x(\ln x + 1), valid for x>0x > 0. You find it by logarithmic differentiation: set y=xxy = x^x, take ln\ln of both sides to get lny=xlnx\ln y = x \ln x, differentiate implicitly to get 1ydydx=lnx+1\frac{1}{y}\cdot\frac{dy}{dx} = \ln x + 1, then multiply by y=xxy = x^x.

Why can't I use the power rule on x^x?

The power rule ddx[xn]=nxn1\frac{d}{dx}\left[x^n\right] = n\,x^{n-1} only works when the exponent nn is a fixed number. In xxx^x the exponent is the variable xx, so the rule does not apply. Forcing it gives xxx^x, which is missing the lnx\ln x term of the real answer.

What is the domain of the derivative of x^x?

As a continuous real function, xx=exlnxx^x = e^{x \ln x}, whose lnx\ln x needs a positive input, so both xxx^x and its derivative are defined only for x>0x > 0. The proof step lny=xlnx\ln y = x \ln x inherits the same restriction, and there is no real derivative at x0x \le 0.

Is x^x the same as e^(x ln x)?

Yes. Rewriting xx=exlnxx^x = e^{x \ln x} gives a second valid method: differentiate the exponent xlnxx \ln x to get lnx+1\ln x + 1, then multiply by exlnx=xxe^{x \ln x} = x^x, which returns the same xx(lnx+1)x^x(\ln x + 1).