# For which complex $a,\,b,\,c$ does $(a^b)^c=a^{bc}$ hold?

Wolfram Mathematica simplifies $(a^b)^c$ to $a^{bc}$ only for positive real $a, b$ and $c$. See W|A output.

I've previously been struggling to understand why does $\dfrac{\log(a^b)}{\log(a)}=b$ and $\log(a^b)=b\log(a)$ not always hold (while I was always thinking of logarithms of positive reals as $\log_a(a^b)=\dfrac{\log(a^b)}{\log(a)}=\dfrac{b\log(a)}{\log(a)}=b$ before I've started to self-study complexes), but then learned about branch cutting of multifunctions, so that natural logarithm can be defined to be a function by first finding a set of $w$ for each $z$, so that $z=e^w$ (inverse natural exponential), and then somehow (no matter how) selecting a unique solution $w$ from that set, so that $\forall{z}\exists!{w}$, yielding a function $z\mapsto{w}$. This results in some sort of discontinuity where solutions are being dropped:

This is done because functions are generally more easy to deal with than multifunctions. Wolfram's convention is to define $\log(z)$ as the inverse of $e^z$ such that $\log(1)=0$ and such that the branch cut discontinuity is at ${(-\infty;0]}$. I know this is somewhat unpopular to think of natural logarithm as a single-valued function, but I am going to follow this convention (I personally think it is well-justified, at least that's what happens with $\operatorname{arcsin}$, $\operatorname{sqrt}$, etc, so in fact I am comfortable with it).

Then it is clear for me why is $\dfrac{\log\left((-2)^{-3}\right)}{\log(-2)}\approx{0.814319+0.841574i}\neq{-3}$, while $-3$ perfectly satisfies the equation $(-2)^x=(-2)^{-3}$.

Given that $\log(a^b)=b\log(a)$ holds for positive real $a, b$ only, I thought how would I then solve equations of form $a^x=b$, where $a,b$ are complexes and not necessarily positive reals, since my first step was always to rewrite everything to base $e$: $$e^{\log(a^x)}=e^{\log(b)}$$ and then carry the exponent out of the logarithm: $$e^{x\log(a)}=e^{\log(b)}$$ (adding $2\pi i k,\,k\in\mathbb{Z}$ to any exponent and then eliminating the exponentials yields the result). So I've asked on ##math, where I've been pointed out that another way to rewrite $a^b$ to base $e$ is using the definition of the logarithm: $a^b=(a)^b=(e^{\log(a)})^b=e^{b\log(a)}$. I was happy with that (and even solved a $(-2)^x=-3$ for $x$ just for fun using this approach, see here) but some time later I have realized that this neither does not actually work for arbitrary complex $a$ and $b$! $$1=1^{1/2}=((-1)^2)^{1/2}=(-1)^{2\cdot\frac{1}{2}}=(-1)^1=-1$$ The rule $(a^b)^c$, as I was told by W|A, requires $a, b, c$ to be positive reals. When I pointed that out on ##math, I was told that $a^b=e^{b\log(a)}$ is by definition of complex exponentiation. I've checked, and Wolfram Mathematica agreed with this identity. Too good! But then I realized from these something must not be true:

• $(a^b)^c=a^{bc}$ holds only for positive real $a,b,c$
• $\forall{a,b\in\mathbb{C}}:a^b=e^{b\log(a)}$
• $\forall{a\in\mathbb{C}}:a=e^{log(a)}$

The latter is the definition of the logarithm, so should be true. The second also must be true, otherwise I do not know how to solve equations. Hence: $$a^c=e^{c\log(a)}$$ is by the definition of complex exponentiation, just as I was told. Then, rewriting $a$ in the LHS using the definition of logarithm: $$a=e^{log(a)}$$ $$\left(e^{log(a)}\right)^c=e^{c\log(a)}$$ Now, since that for every complex $b$ there exists a $z$ such that $b=\log(z)$, we can rewrite $\log(a)=b$: $$(e^b)^c=e^{bc}$$ for all complex $b,c$! So, what is that?

I've made a mistake? Or is base $a=e$ that special?

Or is in fact (I suspect) one just needs to require $a$ to be positive real, and $b,c$ are in fact irrelevant? $$\forall{a}\in\mathbb{R}\forall{b,c}\in\mathbb{C}:a>0\implies{(a^b)^c=a^{bc}}$$ Have I found a bug in Mathematica and W|A or made a huge stupid mistake leading myself to drastic misunderstanding?

P. S. This is my first post at MSE, I am not a math major, just a hobbyist, so sorry if I am struggling at basics here. Also sorry for my English: it is not my native language.

$\forall{a,b,c}:-\pi<\Im(b\log(a))\leq\pi\implies(a^b)^c=a^{bc}$

Very clear and straightforward, works flawlessly.

But it appears that though the implication is obviously true, there are more cases (read "values of $a,\,b,\,c$") from which $(a^b)^c=a^{bc}$ does follow, i.e. I found that it is true for $c\in\mathbb{Z}$ and arbitrary complex $a,\,b$, for example:

$$\big((-2)^{-3}\big)^{-2}=(-2)^{(-3)\times(-2)};$$ $$\left(\frac{1}{(-2)^3}\right)^{-2}=(-2)^{6};$$ $$\left(-\frac{1}{8}\right)^{-2}=64;$$ $$\left(-8\right)^2=64;$$ $$64=64.$$

For this case, $b\log(a)=-3\log(-2)=-3(\log(2)+i\pi)=-3\log(2)-3i\pi$, and hence $\Im(-3\log(2)-3i\pi)=-3\pi\notin{({-\pi;\pi}]}$, therefore @Andrew's implication does not cover all cases.

So, is there any more solutions of $(a^b)^c=a^{bc}$?

• Just saw your update; probably the "@" trick only works in comments? In my answer, the stated claim is "If $b \log a$ has imaginary part between $(2k - 1)\pi$ and $(2k + 1)\pi$, then ... $(a^{b})^{c} = a^{bc}$ if and only if $\exp(2\pi cki) = 1$." The example in your edit ($c$ an integer) fits this claim. :) Other examples would include $c = p/q$ a rational number in lowest terms and $k$ an integer multiple of $q$. Aug 20, 2015 at 16:10
• I am sorry @Andrew I do not understand what do you say. If $k$ should be fixed so that the range is equal to the range of the imaginary part of complex logarithm of selected branch, then, because I set the branch as $\Im\left(\log(z)\right)\in{({-\pi};{\pi}]}$, I fix $k=0$. Then $\exp(2\pi cki)=\exp(0)=1$ for any $c$, hence you literally claim that $(a^b)^c=a^{bc}$ is always true. Aug 20, 2015 at 16:28
• Oh. I've got it. Forget my previous comment. In this case $\Im(b\log(a))=-3\pi$, so from here it follows that $k=-1$, then $\exp(2\pi(-2)(-1)i)=\exp(4\pi i)=1$. Aug 20, 2015 at 16:56
• By the way @Andrew, it does not matter which side of the interval $(2k\mp1)\pi$ is inclusive, can be both, does it? Aug 20, 2015 at 17:19
• "It doesn't matter" with some fine print: If we fix the imaginary part of $\log$ to lie in $(-\pi, \pi]$, then $k$ is defined by "the imaginary part of $b \log a$ is in $\bigl((2k - 1)\pi, (2k + 1)\pi\bigr]$", and the argument is as stated. If the imaginary part of log lies in $[-\pi, \pi)$, the interval defining $k$ gets a corresponding shift of endpoint. That is, shifting the value of $\log$ on the negative reals affects the definition of exponentiation, but "in a consistent way" with the stated conclusion. Aug 20, 2015 at 17:33

If we agree $\log z$ has imaginary part between $-\pi$ and $\pi$ and is defined only on the set $D = \mathbf{C} \setminus(-\infty, 0]$, then \begin{align*} \exp(\log z) &= z\quad\text{for all $z$ in $D$,} \\ \log(\exp z) &= z\quad\text{for all $z$ with imaginary part between $-\pi$ and $\pi$.} \end{align*} If the imaginary part of $z$ is between $(2k - 1)\pi$ and $(2k + 1)\pi$, then $$\log(\exp z) = z - 2\pi ki \tag{1}$$ because $z - 2\pi ki$ has imaginary part between $-\pi$ and $\pi$.

Defining $a^{b} = \exp(b \log a)$, we have \begin{align*} (a^{b})^{c} &= \exp\bigl(c \log(a^{b})\bigr) = \exp\bigl(c \log [\exp (b \log a)]\bigr), \\ a^{bc} &= \exp(bc \log a). \end{align*}

If $b \log a$ has imaginary part between $(2k - 1)\pi$ and $(2k + 1)\pi$, then $\log\bigl(\exp(b \log a)\bigr) = b \log a - 2\pi ki$ by (1), so $$\exp\bigl(c \log(a^{b})\bigr) = \exp\bigl(c(b \log a - 2\pi ki)\bigr) = \exp(bc \log a) \exp(-2\pi cki),$$ which is equal to $a^{bc}$ if and only if $\exp(2\pi cki) = 1$.

In particular, if $b \log a$ has imaginary part between $-\pi$ and $\pi$ (i.e., $k = 0$), or if $c$ is an integer, then $$(a^{b})^{c} = \exp\bigl(c \log(a^{b})\bigr) = \exp\bigl(c \log(\exp b \log a)\bigr) = \exp(bc \log a) = a^{bc}.$$

• Um... $\log$ is defined on ${(-\infty;0)}$, and is also defined at $0$ if we allow the point at infinity. For example, $\log(-2)=\log(2)+\pi i$, $log(0)=-\infty$. Jul 2, 2015 at 23:11
• Hah, FullSimplify[Log[e^z],Assumptions→-π<Im[z]≤π] indeed yields z in Mathematica! Jul 2, 2015 at 23:27
• Cool, I think I'm getting it. Jul 2, 2015 at 23:54
• If $\log(-a) = \log a + i\pi$ for $a > 0$ real, the argument goes through with obvious modifications. :) (Trying to make sense of things for $a = 0$ isn't worth the hassle; there's no notion of signed infinities in $\mathbf{C}$, and $\exp$ has an "essential singularity" at $\infty$, so defining $\log 0 = \infty$ is asking for trouble.) Jul 3, 2015 at 0:38
• the points with affix $0$ and $\tilde{\infty}$. For the former, the vector's beginning is congruent to its ending, so it is a null vector, which is collinear to any vector, hence one cannot determine its angle, hence $arg(0)$ remains undefined, thought can be defined to be any value, if needed. For the latter, the vector's angle can be well-defined if it is defined at all for that particular case. For example, considering a vector connecting the origin with the point at infinity parallel to the positive direction of the real axis, gives you the positive infinity $\infty$. Jul 3, 2015 at 3:38

This is a late post. But just to make it clear for future readers, the error in your question is here:

... for every complex $b$ there exists a $z$ such that $b=\log(z)$, ...

This is false since you already chose $\log$ to be a function, and you cannot choose to have both $\log(1) = 0$ and $\log(1) = 2πi$, which implies that either $0$ or $2πi$ will not be a possible value of $\log$ since $\exp(0) = 1 = \exp(2πi)$. To put it algebraically, it cannot be that we have both $\log(z) = b$ and $\log(w) = b+2πi$ for some complex $b,z,w$, otherwise $z = \exp(b) = \exp(b+2πi) = w$ and hence $\log(z) = \log(w)$, contradicting $b \ne b+2πi$.