Wolfram Mathematica simplifies (ab)c to abc only for positive real a,b and c. See W|A output.
I've previously been struggling to understand why does log(ab)log(a)=b and log(ab)=blog(a) not always hold (while I was always thinking of logarithms of positive reals as loga(ab)=log(ab)log(a)=blog(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=ew (inverse natural exponential), and then somehow (no matter how) selecting a unique solution w from that set, so that ∀z∃!w, yielding a function z↦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 ez such that log(1)=0 and such that the branch cut discontinuity is at (−∞;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 arcsin, sqrt, etc, so in fact I am comfortable with it).
Then it is clear for me why is log((−2)−3)log(−2)≈0.814319+0.841574i≠−3, while −3 perfectly satisfies the equation (−2)x=(−2)−3.
Given that log(ab)=blog(a) holds for positive real a,b only, I thought how would I then solve equations of form ax=b, where a,b are complexes and not necessarily positive reals, since my first step was always to rewrite everything to base e:
elog(ax)=elog(b)
and then carry the exponent out of the logarithm:
exlog(a)=elog(b)
(adding 2πik,k∈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 ab to base e is using the definition of the logarithm: ab=(a)b=(elog(a))b=eblog(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=11/2=((−1)2)1/2=(−1)2⋅12=(−1)1=−1
The rule (ab)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 ab=eblog(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:
- (ab)c=abc holds only for positive real a,b,c
- ∀a,b∈C:ab=eblog(a)
- ∀a∈C:a=elog(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:
ac=eclog(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=elog(a)
(elog(a))c=eclog(a)
Now, since that for every complex b there exists a z such that b=log(z), we can rewrite log(a)=b:
(eb)c=ebc
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?
∀a∈R∀b,c∈C:a>0⟹(ab)c=abc
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.
Edit: thank you @Andrew for your answer.
∀a,b,c:−π<ℑ(blog(a))≤π⟹(ab)c=abc
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 (ab)c=abc does follow, i.e. I found that it is true for c∈Z and arbitrary complex a,b, for example:
((−2)−3)−2=(−2)(−3)×(−2);
(1(−2)3)−2=(−2)6;
(−18)−2=64;
(−8)2=64;
64=64.
For this case, blog(a)=−3log(−2)=−3(log(2)+iπ)=−3log(2)−3iπ, and hence ℑ(−3log(2)−3iπ)=−3π∉(−π;π], therefore @Andrew's implication does not cover all cases.
So, is there any more solutions of (ab)c=abc?
Answer
If we agree logz has imaginary part between −π and π and is defined only on the set D=C∖(−∞,0], then
exp(logz)=zfor all z in D,log(expz)=zfor all z with imaginary part between −π and π.
If the imaginary part of z is between (2k−1)π and (2k+1)π, then
log(expz)=z−2πki
because z−2πki has imaginary part between −π and π.
Defining ab=exp(bloga), we have
(ab)c=exp(clog(ab))=exp(clog[exp(bloga)]),abc=exp(bcloga).
If bloga has imaginary part between (2k−1)π and (2k+1)π, then log(exp(bloga))=bloga−2πki by (1), so
exp(clog(ab))=exp(c(bloga−2πki))=exp(bcloga)exp(−2πcki),
which is equal to abc if and only if exp(2πcki)=1.
In particular, if bloga has imaginary part between −π and π (i.e., k=0), or if c is an integer, then
(ab)c=exp(clog(ab))=exp(clog(expbloga))=exp(bcloga)=abc.