When the variable is in the base and the exponent at once, take logarithms first.
\[\frac{d}{dx}f^{g} = f^{g}\left(g'\ln f + \frac{gf'}{f}\right)\]
What it says
For \(x^{x}\) neither standard rule fits: the power rule needs a constant exponent, the exponential rule a constant base. Taking logarithms fixes it, because \(\ln\) turns an exponent into an ordinary factor.
Write \(y = f^{g}\). Then \(\ln y = g\ln f\); differentiating both sides gives \(\frac{y'}{y} = g'\ln f + \frac{gf'}{f}\), and multiplying by \(y = f^{g}\) gives the formula above. The two terms have a clear reading: the first is the change coming from the exponent, the second from the base.
The same trick is useful even when it is not required. A long product or quotient can be turned into a sum of logarithms, differentiated term by term, then multiplied back — often much less work than nested product rules.
When it applies
The variable appears in both the base and the exponent.
Towers such as \(x^{x}\), \(x^{\sin x}\) or \((\sin x)^{\cos x}\).
Optionally, to tame a product or quotient with many factors.
Five worked examples
Every line is the step the calculator would show, in the order it applies them. Each graph
is live: hover it to read both curves and see the tangent whose slope is the derivative,
drag to pan, scroll to zoom.
1
Example 1
\[\frac{d}{dx}\left[x^{x}\right]\]
Take logs: \(\ln y = x\ln x\).
\[\frac{y'}{y} = \frac{d}{dx}\left[x\ln x\right] = \ln x + 1\]
Multiply back by \(y = x^{x}\).
\[= x^{x}\left(\ln x + 1\right)\]
Answer
\[x^{x} \left(\ln\left(x\right) + 1\right)\]
Only for \(x > 0\). The curve dips into a shallow trough near the left edge, then rises so fast that the framing pulls in to keep it on screen. f′ climbs from below the axis, through zero at the trough, and away.
Zero at \(x = \frac{1}{e}\), which is where \(x^{x}\) reaches its minimum of about \(0.6922\).