# $x^x$ for non-positive values of $x$

Mathcad, Wolfram, Google, and a couple of online graphing engines all indicate that $x^x$ is undefined for non-positive values of $x$. But isn't $x^x$ defined for negative integers? Eg. $(-3)^{-3} = -(\frac{1}{27})$, isn't it? What am I missing here?

-
The problem occurs when you try to take even roots of negative numbers. For instance $(-1)^{-\frac{1}{2}}$ is undefined over the real numbers. – Joe Johnson 126 Jan 29 '12 at 18:58
But (-1)^(-1/2) isn't a value of x^x. In any case, if x^x is undefined for ALL non-positive x, then how do we explain (-3)^(-3) ? – Ryan Jan 29 '12 at 19:04
It'd be $e^{x\log x}$ which is defined for $x>0$. – Gigili Jan 29 '12 at 19:04
Well, isn't that like saying the graph of y=x is defined only for x>0 since e^(ln x) is defined only for x>0 ? – Ryan Jan 29 '12 at 19:07
It is defined for negative integers, and for negative rational fractions for which the denominator is odd, but it isn't defined on any continuous environment. – yaakov Jan 29 '12 at 19:15

Certainly $(-3)^{-3}$ has a well-defined value.

The basic problem here is that an expression such as "$x^x$" is actually not enough to define a function. One also needs to a specification of which domain the values of $x$ can be drawn from.

Many school systems place great value on teaching their students to find the greatest subset of the reals for which the expression has a value, and call that the domain of the expression, but it is not a universal mathematical law that this has to be true. (In fact, mathematicians tend to scoff at the idea that $\mathbb R$ should have such a favored status that it is the largest subset of it that becomes "the" domain of an expression).

What computer mathematics systems such as the ones you've tried do when you present them with a naked expression such as $x^x$ is to try to guess which domain you could have had in mind for them. Rather than the largest set of numbers that the expression makes sense for, they usually try to guess at the nicest set, for some not really well defined sense of "nicest". And sets such as $(0,\infty)$ is generally considered more likely than $(0,\infty)\cup\mathbb Z$, if only because the union between a continuous set and a discrete one looks like there will be few or no interesting properties in common between the two parts.

However, mathematically you're certainly free to define a function $f$ such that $f(x)=x^x$ for $x\in(0,\infty)\cup\mathbb Z$ if you want to.

-
Thank you Henning for your excellent and satisfying elucidation! I've just went back to my Mathcad and explicitly set the range of x to include the negative integers, and indeed, the graph now reflects the values I was initially expecting. How would I cope without this forum? haha – Ryan Jan 29 '12 at 19:43
@Ryan: It's not a forum, this is a Q&A site which is exactly what makes it lovely. – Gigili Jan 29 '12 at 20:22