# Calculator's graph for $x^x$ when $x<0$

When I put this into a handheld graphing calculator, there are lots of little dots when it is negative and I'm wondering what the program is doing.

From what I understand, $$x^x$$ is defined for positive x-values, is undefined for x equaling zero, but when I have negative numbers it seems to be points that could make curves above and below the x axis (similar to $$\pm\frac{1}{x}$$).

From what I've read (and understand), the function $$f(x)=x^x$$ is undefined when it's negative since the same input might give different answers. For example $$f\left(-\frac{1}{2}\right)$$ should equal $$f\left(-\frac{2}{4}\right)$$ since the inputs are the same, but $$\left(-\frac{1}{2}\right)^{-\frac{1}{2}}=\frac{1}{-\frac{1}{2}^{\frac{1}{2}}} = \frac{1}{\sqrt{-\frac{1}{2}}}$$ and that's not a real number, while $$\left(-\frac{2}{4}\right)^{-\frac{2}{4}}=\frac{1}{-\frac{2}{4}^{\frac{2}{4}}} = \frac{1}{\sqrt[4]{\left(-\frac{2}{4}\right)^{2}}} = \frac{1}{\sqrt[4]{\frac{4}{16}}} = \frac{1}{\sqrt{\frac{2}{4}}}$$ and that's a real number. Since the dot appears, it seems the calculator is finding equivalent inputs that give real number outputs.

What is the calculator doing, and how should we think of $$x^x$$ for negative numbers?

• The calculator is saying "what? huh? what am I supposed to do with this? well, I'll try something (kaplink, kaplunk) how's that?". Poor calculator, it's not quite up to the task of informing you that your function is undefined. While you can use certain published computational/mathematical standards to understand what calculators do with viable functions, presumably you can always break the calculator by giving it something which is badly defined. Dec 21 '19 at 1:54
• It may be that the calculator is only showing the points for negative integers, as x^x will be defined for negative integers. Dec 21 '19 at 1:54
• Have you had a look at those links, Sat? Dec 22 '19 at 16:03
• I've seen some of them before but the 3rd was new: math.stackexchange.com/questions/398268/the-graph-of-xx thanks :D
– user612996
Dec 23 '19 at 0:19

Actually, you can't do $$\sqrt{x} = x^\frac{1}{2} = x^\frac{2}{4} = \sqrt[4]{x^2}$$ in general for anything outside of the positive reals.

## Rational Exponents

$$x^x$$ is defined somewhere on the real number line as long as $$x$$ is a negative integer or a rational number with an odd denominator when fully reduced. Any other value of $$x$$ will produce an answer that is undefined on the real number line.

To explain why, let me cut to the chase and bypass some technical math to help you visualize the intuition.

For starters, we need to look at the set of complex numbers. We can write complex numbers as $$x+yi$$, but they can also be represented in what is called polar form, as an angle and a magnitude.

Accept the following: When we multiply two complex numbers together, we multiply their magnitudes (not as important for this topic) and add their angles (very important). For example, the complex numbers at $$(1, 30^\circ)$$ and $$(1, 40^\circ)$$ will have a product located at $$(1, 70^\circ)$$.

Whenever you take a square root of a complex number, realize that there are two complex numbers you can square that will get you to that number. If the original complex number has an angle of $$20^\circ$$, the root could either be $$10^\circ$$ or $$190^\circ$$, because $$190^\circ \cdot 2 = 380^\circ = 20^\circ$$. You can see why the second angle solution is tricky, and so that's why we consider the $$10^\circ$$ solution the principal root, even though the other one can be squared to get the same value.

This is why the positive reals (with angle $$0^\circ$$) can have square roots of $$0^\circ$$ (the positive root), and $$180^\circ$$ (the negative root), and why we consider the positive root the principal one.

When you plot all of the roots of a complex number, they will evenly divide the $$360^\circ$$ circle around the root. For instance, here are where all the 5th roots of $$-1$$ are:

Here are the sixth roots of $$-1$$:

We can take any odd root and still hit $$-1$$, but we can't for an even root. Hence, the denominator must be odd in order for a real solution to exist.

$$\frac{180^\circ + n \cdot 360^\circ}{2n+1} = \frac{(2n+1)180^\circ}{2n+1} = 180^\circ \\ \frac{180^\circ + k \cdot 360^\circ}{2n} = \frac{(2k+1)180^\circ}{2n} \ne 180^\circ$$ The last statement cannot hold true for any $$k$$ value because $$2k+1$$ is odd and $$2n$$ is even, which means the expression cannot be a whole number.

This is also why your fraction must be simplified. Taking $$-1$$ to the $$\frac{1}{2}$$ power gives us angles of $$90^\circ$$ and $$270^\circ$$. Taking $$-1$$ to the $$\frac{2}{4}$$ power is multiplying the angle by $$2$$, then splitting into $$4$$, which gives us angles of $$0^\circ$$ and $$180^\circ$$ in addition to the other two, giving you extraneous solutions.

## Real Exponents

Accept the following: In general, to convert a polar form complex number to rectangular form, we use the formula: $$re^{i\theta} = r(\cos\theta + i \sin\theta)$$

Since $$\theta$$ can be any real value, this tells us that we can substitute values into this formula to obtain any value we want for a negative exponent, even an irrational one!

First note the following (we will use this later): $$-1 = e^{i \pi} \\ \ln(-1) = i \pi$$ Technically, there are an infinite number of values for $$\ln(-1)$$, but we will once again take the simplest one, the principal solution.

Now use change of base (assume $$x$$ is negative): $$x^x = e^{x \ln x} \\ \ln x = \ln{(-x)} + \ln{(-1)} \\ \ln x = \ln{(-x)} + i\pi \\ e^{x \ln x} = e^{x\ln{(-x)} + i\pi x } = e^{x\ln{(-x)}} e^{ i\pi x } \\$$

We can see that the $$e^{x\ln{(-x)}}$$ part is a real number. Let's look at the other part. $$e^{ i\pi x } = \cos{\pi x} + i \sin{\pi x}$$

So finally, we can compute that for any negative $$x$$: $$x^x = e^{x\ln{(-x)}}(\cos{\pi x} + i \sin{\pi x})$$

This is now a well-defined complex number!

## Calculator Issues?

The reason why your calculator has breaks in it, is because of how it tests and samples values. If it picks decimal values, it will never be able to evaluate any of these on the real number line except for the negative integer values. If it can somehow do these complex operations and can test exact rational values by the formula I gave using symbolic evaluation, then it will give you some values for the ones it tests. But otherwise, you won't have much luck, since most all of these values will give you complex numbers!