The domain of $f(x)=x^{1/x}$ I've been taught that the domain of the function $f(x) = x^{1/x}$ is $x > 0$ assuming the function to be from $\mathbb{R} \to \mathbb{R}$. But $f(-1) = (-1)^{(-1)} = -1$, so why does the domain not include $x = -1$?

A few things:

*

*The notation "$f:X\to Y$" means that the domain of $f$ is $X$ and its codomain is $Y$. So it does not make sense to say "the domain of the function $f:\Bbb{R}\mapsto\Bbb{R}$ given by $f(x)=x^{1/x}$ is $x>0$".

*Formally, a function is set of input-out pairs, and to specify that set, you have to state the domain. In practice, mathematicians are a little sloppy, and the domain is often assumed to be the set of real numbers that make sense when you plug them into a formula, unless otherwise specified. This set is sometimes called the "natural domain" of $f$.

*With the above in mind, we can try to find the "natural domain" of $f(x)=x^{1/x}$. For $x>0$, the definition of $x^y$ is typically $\exp(y\log x)$. This definition works makes sense for irrational exponents as well as rational ones. However, if $x$ is negative, then there are instances where $x^{1/x}$ according to the "schoolbook" definition of exponentiation (e.g. when $x=-1$ as you have mentioned in your question).

*Nevertheless, the set of negative $x$ for which $x^{1/x}$ makes sense is only countable, meaning that negative exponents are extremely ugly to work with in analysis. Because of this, some authors try to avoid this mess entirely by only defining $x^y$ for $x>0$. (This is particularly common if the exponent is variable rather than constant.) The only time where negative bases ever come up is when dealing with polynomials such as $x^2$, and perhaps with odd power roots as well.

*The moral of the story is that the author about how exactly $f$ is being defined: right now it is not clear.

