Lambdia

The Slope of x to the x Is Both Wrong Answers Added

Logarithmic differentiation turns the exponent into a factor and gives x^x times (1 + ln x), which is exactly the sum of the power-rule answer x^x and the exponential-rule answer x^x ln x. That is a theorem rather than a coincidence: the two rules are the partial derivatives of u^v, and walking the diagonal u = v = x adds both partial effects. The power rule accidentally returns the correct slope at x = 1, which is the one point nobody should use to test a rule.

Differentiate xxx^x. The answer is

ddxxx=xx(1+lnx)\frac{d}{dx}\,x^x = x^x\left(1 + \ln x\right)
(1)

and the interesting part is that the two rules a student reaches for are both wrong, and their sum is exactly right. That is not a coincidence to be memorised. It is a theorem, and knowing which one makes a class of similar problems routine.

Two rules, neither of which applies

The power rule handles xax^a with a constant exponent. Applying it here, treating the exponent as if it were frozen, gives

xxx1=xxx \cdot x^{x-1} = x^x
(2)

which is a valid piece of algebra applied to an invalid premise. The exponential rule handles axa^x with a constant base. Applying that instead, freezing the base, gives xxlnxx^x \ln x.

At x=2x = 2 these read 4 and 4ln2=2.77264\ln 2 = 2.7726, while the true slope is 4(1+ln2)=6.77264(1 + \ln 2) = 6.7726. Both candidates are too shallow, and neither is a rewriting of the other, so this is a real disagreement rather than a notational one.

Fig. 1 — The two rival answers at x = 2, drawn as tangent lines. Both lie under the curve, which is the visual form of the statement that each rule accounts for only part of the change.

The route that works

Take logarithms first. The function is positive for x>0x > 0, so writing y=xxy = x^x and lny=xlnx\ln y = x\ln x is legitimate, and the right side is now a product of two things whose derivatives are known:

yy=ddx(xlnx)=lnx+x1x=1+lnx\frac{y'}{y} = \frac{d}{dx}\left(x\ln x\right) = \ln x + x\cdot\frac1x = 1 + \ln x
(3)

Multiplying back by y=xxy = x^x gives equation (1). The move that made it easy was turning an exponent into a factor, which is the one thing logarithms are for.

Logarithmic differentiation

For a positive differentiable yy, the derivative of lny\ln y is y/yy'/y, so any equation for lny\ln y can be differentiated and then multiplied through by yy. It is the standard tool whenever the variable appears in an exponent, and it needs positivity, which is why the whole discussion below lives on x>0x > 0.

A second route, if the implicit step feels uncomfortable, is to rewrite the function outright as xx=exlnxx^x = e^{x\ln x} and apply the chain rule. The derivative of the exponent is 1+lnx1 + \ln x again, and the outer derivative reproduces exlnx=xxe^{x\ln x} = x^x. Same answer, and it makes plain that there was only ever one function here, not a power and an exponential in disguise.

Why the two wrong answers add up

Consider uvu^v as a function of two independent variables. Its partial derivatives are the two rules, each holding the other slot fixed:

uuv=vuv1,vuv=uvlnu\frac{\partial}{\partial u}\,u^v = v\,u^{v-1}, \qquad \frac{\partial}{\partial v}\,u^v = u^v \ln u
(4)

Now walk along the diagonal u=v=xu = v = x. The chain rule for a function of two variables says the total rate of change is the sum of the two partial effects, each multiplied by the rate of its own variable, which is 1 in both cases:

ddxxx=xxx1base moving  +  xxlnxexponent moving  =  xx(1+lnx)\frac{d}{dx}\,x^x = \underbrace{x \cdot x^{x-1}}_{\text{base moving}} \;+\; \underbrace{x^x \ln x}_{\text{exponent moving}} \;=\; x^x\left(1 + \ln x\right)
(5)

So the two rules were not wrong in the sense of being nonsense. Each of them correctly measured one of the two ways the function changes, and each of them silently discarded the other. This is the reason the two errors are complementary rather than independent, and it is why striking both out as worthless would misrepresent the situation.

The same argument works unchanged for f(x)g(x)f(x)^{g(x)} , and gives the general rule

(fg)=fg(glnf+gff)\left(f^{\,g}\right)' = f^{\,g}\left(g' \ln f + \frac{g\,f'}{f}\right)
(6)

with equation (1) recovered by f=g=xf = g = x. Equation (6) is worth carrying because it never needs to be rediscovered under pressure, and because the two terms in it are visibly the two partial effects from equation (4).

Three points where the answer can be tested

At x=1/ex = 1/e the bracket in equation (1) is 1+ln(1/e)=01 + \ln(1/e) = 0, so the slope is exactly zero. That is the bottom of the dip, with value e1/e=0.69220e^{-1/e} = 0.69220. The power rule claims the slope there is (1/e)1/e=0.69220(1/e)^{1/e} = 0.69220, which is plainly not the slope at a minimum. Checking the second derivative confirms the shape:

(xx)=xx[(1+lnx)2+1x],at x=1e:  e1/ee=1.8816>0\left(x^x\right)'' = x^x\left[\left(1 + \ln x\right)^2 + \frac1x\right], \qquad \text{at } x = \tfrac1e: \; e^{-1/e}\cdot e = 1.8816 > 0
(7)

At x=1x = 1 something awkward happens. The bracket is 1, so the true slope is 1, and the power rule gives 110=11 \cdot 1^0 = 1 as well. The rule that does not apply produces the right number at that one point. Anyone who spot-checks a rule at x=1x = 1 will conclude it works, which is a general hazard of testing at points where several quantities collapse to 1.

And as x0+x \to 0^{+}, xlnx0x\ln x \to 0, so xx1x^x \to 1 while the slope xx(1+lnx)x^x(1 + \ln x) \to -\infty. The curve arrives at height 1 with a vertical tangent, which is the steep left edge in figure 1.

Fig. 2 — The three candidate derivatives as functions of x. They agree at exactly one point, which is the one point nobody should use as a test.

The same method on the next floor up

The real test of a method is whether it survives being asked again. Take y=xxxy = x^{x^x}, where the exponent is itself the function we just differentiated. The logarithmic route needs no new ideas: lny=xxlnx\ln y = x^x \ln x, and differentiating that product uses equation (1) for one of its factors:

yy=xx(1+lnx)lnx+xxx    (xxx)=xxx[xxlnx(1+lnx)+xx1]\frac{y'}{y} = x^x\left(1 + \ln x\right)\ln x + \frac{x^x}{x} \;\Longrightarrow\; \left(x^{x^x}\right)' = x^{x^x}\left[x^x \ln x\left(1 + \ln x\right) + x^{x-1}\right]
(8)

No new rule was needed, and the same would be true of a tower four levels high. That is the payoff of equation (3) over memorising equation (1): the method composes, and the answer does not have to be recognised.

Where the function stops existing

Everything above assumed x>0x > 0, and that is not caution for its own sake. For negative xx, xxx^x is real only on a scattered set: it is 1/41/4 at x=2x = -2 and undefined over the reals at x=1/2x = -1/2, since that would ask for a square root of a negative number. A set with no interval in it has no derivative anywhere, so equation (1) has nothing to say there. The complex extension exists and is multivalued, and it is a different subject.

One last thing, mostly for pleasure. The function is awkward to differentiate and its integral over the unit interval has a startling closed form:

01xxdx=n1(1)n1nn=0.7834305\int_0^1 x^x\,dx = \sum_{n\ge1}\frac{(-1)^{n-1}}{n^n} = 0.7834305\ldots
(9)

which converges absurdly fast, six terms giving five correct digits. The companion identity 01xxdx=n1nn=1.2912860\int_0^1 x^{-x}dx = \sum_{n\ge1} n^{-n} = 1.2912860\ldots comes from the same expansion with the signs left alone.

Sources and further reading

Equation (1) was measured as well as derived: the slope was estimated by Richardson-extrapolated central differences at sixty-three points across (0,4](0, 4], matching the formula to a worst error of 3×10123 \times 10^{-12}. A ternary search located the minimum at 0.367879451 against 1/e=0.3678794411/e = 0.367879441, where the measured slope was 7×1013-7 \times 10^{-13} while the power rule claimed 0.692201.

Comments · 0

Be the first to comment.