How does logarithmic differentiation give the derivative of f(x) = x^x?
answer
- take logs of both sides first
- base and exponent both vary here
- the log-derivative equals f prime over f
- product rule on x times ln x
- multiply back by the original function
basics
~20 sTake logs first: ln y = x ln x for y = x^x, which differentiates to y'/y = ln x + 1, giving y' = x^x times (ln x + 1). Base and exponent both vary, so neither standard rule applies.
solid answer
~40 sThe trick rests on the identity `d/dx ln f(x) = f'(x)/f(x)`, the log-derivative. Set `y = x^x` for `x > 0` and take logs: `ln y = x*ln x`. Differentiating the left side gives `y'/y`; differentiating the right side by the product rule gives `1*ln x + x*(1/x) = ln x + 1`. So `y'/y = ln x + 1` and hence `y' = y*(ln x + 1) = x^x*(ln x + 1)`. The power rule fails here because it assumes a constant exponent, and the rule `d/dx a^x = a^x*ln a` fails because it assumes a constant base; `x^x` has both varying. An equivalent route is to write `x^x = e^(x*ln x)` and differentiate the exponential form. The same technique turns any long product or quotient into a sum of log-derivatives.
go deeper
Recognise that x^x is neither a plain power nor a plain exponential, and that taking logs of both sides is the standard opening move.
Run the computation end to end: log both sides, differentiate the left as y prime over y, use the product rule on the right, then multiply back by the function.
Show the wider payoff — logarithmic derivatives turn long products and quotients into sums, and they express growth in relative rather than absolute terms.
Argue when reformulating in log space is the right move for a whole calculation, weighing the numerical and interpretive benefits of working with relative rates against the added domain restrictions.
### The obstacle Two standard rules handle powers: - **Power rule**: `d/dx x^n = n*x^(n-1)` — valid when the **exponent** `n` is a constant. - **Exponential rule**: `d/dx a^x = a^x*ln a` — valid when the **base** `a` is a constant. The function `x^x` satisfies neither hypothesis: the base and the exponent are both the variable. Applying either rule blindly gives a wrong answer — `x*x^(x-1)` from the first, `x^x*ln x` from the second — and quoting one of those is the classic failure on this question. It is also worth noting that `x^x` is only defined in the ordinary sense for `x > 0`, so that domain restriction belongs in the answer. ### The log-derivative identity For a positive differentiable function `f`, ``` d/dx ln f(x) = f'(x) / f(x) ``` Differentiating the logarithm produces the reciprocal of its argument, multiplied by the derivative of that argument. The quantity `f'/f` is called the **logarithmic derivative** and has a direct meaning: it is the *relative* rate of change of `f`, the proportional change per unit of `x`, as opposed to the absolute change measured by `f'`. ### Applying it to x^x Write `y = x^x` with `x > 0` and take natural logs of both sides. The log of a power brings the exponent down as a factor: ``` ln y = x * ln x ``` Now differentiate both sides with respect to `x`. **Left side.** By the log-derivative identity applied to `y` as a function of `x`, it becomes `y'/y`. **Right side.** This is a product, so the product rule `(uv)' = u'v + uv'` applies with `u = x` and `v = ln x`: ``` 1*ln x + x*(1/x) = ln x + 1 ``` Setting the two sides equal: ``` y'/y = ln x + 1 ``` Multiplying through by `y` and substituting the original expression back: ``` y' = y*(ln x + 1) = x^x * (ln x + 1) ``` The last step — multiplying back by `y` — is the one candidates most often forget, leaving the answer stuck as a relative rate. **A sanity check.** At `x = 1` the formula gives `1^1*(0 + 1) = 1`, so the curve passes through the point `(1, 1)` with slope 1. That is consistent with the function being close to `x` near that point. ### The equivalent exponential route Any positive base can be rewritten through the exponential: `x^x = e^(x*ln x)`. Differentiating that form gives `e^(x*ln x)` multiplied by the derivative of the exponent, which is again `ln x + 1`, and `e^(x*ln x)` is `x^x`. The two routes are the same computation dressed differently; the log route avoids having to rewrite the function at all. ### Why the technique is worth knowing **It recovers the other rules.** For `y = x^n` with constant `n`: `ln y = n*ln x`, so `y'/y = n/x` and `y' = n*x^n/x = n*x^(n-1)` — the power rule. For `y = a^x` with constant `a`: `ln y = x*ln a`, so `y'/y = ln a` and `y' = a^x*ln a` — the exponential rule. Both fall out of a single method. **It turns products into sums.** If `f` is a product of many factors, `ln f` is a sum of logs, and the logarithmic derivative of the whole is simply the sum of the individual logarithmic derivatives: ``` f = g*h implies f'/f = g'/g + h'/h f = g/h implies f'/f = g'/g - h'/h ``` Differentiating a product of six factors directly is an error-prone cascade of product rules; differentiating its log is six easy terms added together, after which one multiplication by `f` recovers the derivative. **It measures growth in relative terms.** Because `f'/f` is the proportional rate of change, it is the natural quantity when comparing things of different scales — a slope of 5 units per unit means something quite different for a quantity near 10 than for one near 10000, while the logarithmic derivative is scale-free. ### Pitfalls - Forgetting `x > 0`, without which the logarithm and the expression itself are not defined in the ordinary reals. - Differentiating `ln y` as `1/y` and dropping the `y'` factor, which loses the entire left-hand side of the equation. - Stopping at `y'/y = ln x + 1` and calling it the derivative. - Applying the power rule or the exponential rule directly and producing `x*x^(x-1)` or `x^x*ln x`. Notice that the correct answer is the sum of a term resembling each of those wrong answers, which is a memorable way to keep it straight.
- Why can the power rule not be applied directly to x^x?The power rule `d/dx x^n = n*x^(n-1)` assumes the exponent `n` is a constant, and the rule `d/dx a^x = a^x*ln a` assumes the base is constant. In `x^x` both vary at once, so neither hypothesis holds. Taking logs, or rewriting as `e^(x*ln x)`, is what removes the difficulty.
- What does the same technique give for a^x with a constant a > 0?Set `y = a^x`, so `ln y = x*ln a`. Differentiating gives `y'/y = ln a`, since `ln a` is a constant multiplier of `x`. Multiplying back yields `y' = a^x*ln a`. The standard exponential rule therefore drops straight out of the logarithmic method.
- What does the quantity f'(x)/f(x) mean on its own?It is the logarithmic derivative: the proportional or relative rate of change of `f`, as opposed to the absolute rate `f'`. It is scale-free, so it compares growth across quantities of very different magnitudes, and for a product of factors it is simply the sum of the individual logarithmic derivatives.
Taking logs is like switching from measuring absolute change to measuring percentage change. Percentages add where quantities multiply, so a tangle of products collapses into a simple sum that is easy to differentiate, and one final multiplication converts back.
saying these in an interview costs you the question
- Answers x times x^(x-1) by misapplying the power rule
- Answers x^x times ln x by misapplying the exponential rule
- Omits the domain restriction x greater than zero
- Differentiates ln y as 1/y and drops the y prime factor
- Stops at the relative rate without multiplying back by the function