# Taylor expansion of $x^x$ at $x = 0$

How can I expand $x^x$ in Taylor series if it isn't defined in $x=0$?

$x^x=e^{x \ln x}$, so when I apply Taylor's formula at $x_0=0$ the first term $f(x_0)$ is not defined, but this is a known formula where the first term is $1$.

How is that possible?

Thank you.

• You can't expand it around $x = 0$. – embedded_dev Jun 14 '17 at 17:01
• A Taylor series always has an almost symmetric interval of convergence about its center point (other than at the endpoints), whereas $x^x$ is not defined for $x<0$. – Daniel Schepler Jun 14 '17 at 17:16
• After you ask a question here, if you get an acceptable answer, you should "accept" the answer by clicking the check mark ✓ next to it. This scores points for you and for the person who answered your question. You can find out more about accepting answers here: How do I accept an answer?, Why should we accept answers?. – Clement C. Jun 16 '17 at 18:51

The right-hand limit of $x^x$ is $\lim_{x \searrow 0} x^x = 1$, so one could either ask about the function $f$ defined to have value $1$ at $0$ and $x^x$ elsewhere where defined, or just use the convention that $0^0 = 1$. In this way, there's no problem with computing the zeroth-order term of the expansion.

On the other hand, for $x > 0$ we have $\frac{d}{dx} (x^x) = (1 + \log x) x^x$, so $\lim_{x \searrow 0} \frac{d}{dx} (x^x) = -\infty$, and hence there is no first-order Taylor approximation to the function.

Now, we can write $x^x = \exp (x \log x)$ and so expand $x^x$ in a series of a slightly different form that converges to $x^x$ for $x \geq 0$, namely, $$x^x \sim \sum_{k = 0}^{\infty} \frac{1}{k!} (x \log x)^k = 1 + x \log x + \frac{1}{2} x^2 \log^2 x + O(x^3 \log^3 x) .$$

• What formula do we use for the lastone expansion? – pter26 Jun 14 '17 at 17:17
• This is simply writing out the usual Taylor expansion for $\exp u$ about $u = 0$ and substituting $u = x \log x$ (which makes sense, since $\lim_{x \searrow 0} x \log x = 0$). – Travis Willse Jun 14 '17 at 18:27

Since $x\ln x\xrightarrow[x\to 0]{} 0$, you can use the expansion of $e^u$ (when $u\to0$) to write $$e^{x\ln x} = 1+x\ln x+\frac{x^2\ln^2 x}{2} + o(x^2\ln^2 x)$$ (and have extra terms if you want; I stopped at order $2$). But that does not follow immediately from Taylor's theorem. (And indeed, Taylor's theorem would only give you a polynomial approximation: here, you get terms involving logarithms.)

• For completeness: what was used here is that $$e^u = 1+u + \frac{u^2}{2}+\frac{u^3}{6} + \dots+\frac{u^k}{k!}+o(u^k)$$ when $u\to 0$, for any fixed integer $k\geq 0$. – Clement C. Jun 14 '17 at 17:26
• The firt term of e^u is defined because of sositution? – pter26 Jun 14 '17 at 17:30
• The above is the Taylor expansion of $u\mapsto e^u$ around $0$, and is well-defined. Since $x\ln x \to 0$ when $x\to 0$, one can "plug in $u=x\ln x$" in this expansion (technically, compose it) to get the result (intuitively, "if $f(u) \approx g(u)$ whenever $u$ is small, then $f(x\ln x) \approx g(x\ln x)$ whenever $x$ is small enough, because then $x\ln x$ is small too"). But the composition of the two, while valid, is not a Taylor series expansion -- since otherwise it would only have powers of $x$, not also logarithms. – Clement C. Jun 14 '17 at 17:32