Difference in exp(a*b) and (exp(a))^b when b is a fraction and a is a complex number

60 views (last 30 days)
Hello,
For eg if i take a complex number
d1 =
-5 + 15.3884176858763i
>> exp(d1*0.1)
ans =
0.0193781210641954 + 0.606221023716156i
>> (exp(d1))^0.1
ans =
0.58253862364826 + 0.168902910364011i
Why is there a difference in the above two?
As far as I understand, they should be the same values. Please help
Thanks in advance
Saloni Tandon

Accepted Answer

John D'Errico
John D'Errico on 10 Mar 2022
Edited: John D'Errico on 10 Mar 2022
They look like they should be the same, yes. But sometimes your intuition about what is mathematically correct leads you astray when you don't fully appreciate the mathematics. Take your example, as an example of exactly this.
d1 = -5 + 15.3884176858763i;
A simple complex number. If we form this:
exp(d1*0.1)
ans = 0.0194 + 0.6062i
Then we get a simple, unique result. Nothing complicated there, right? But suppose we form this:
exp(d1)^0.1
ans = 0.5825 + 0.1689i
And we see something completely different. Wow! Is that confusing, or what? Well, not so. The problem is, you need to recognize what the second expression means. You are effectively taking the 10th root of a number, because you are raising it to the power (1/10). And just as there are two possible square roots of a number, for example there are actually two solutions to the problem x^2==1, there are TEN(10) possible 10th roots of that number. Only one of them gets returned to you. But here, it is a different 10th root.
We can see all 10 possible solutions listed using this:
syms x
xsol = vpasolve(x^10 == exp(d1))
xsol = 
Do you see that what MATLAB returned as exp(d1*0.1) is the 6th solution on that list? And what MATLAB returns as the result of exp(d1)^0.1 is also on the list, as number 10?
The point is you have posed a problem that seems simple, but actually has a non-unique answer.
If we look at the number exp(d1) in the complex plane, where does it lie?
angle(exp(d1))
ans = 2.8220
abs(exp(d1))
ans = 0.0067
So in polar coordinates, it lies at a distance of 0.0067 units from the origin, and at an angle of 2.8220 radians, or 161 degrees, for those more comfortable in degrees.
angle(exp(d1))*180/pi
ans = 161.6914
Each of the 10 possible solutions that exist for the 10th root lie equally spaced around the origin, in a perfect circle.
double(angle(xsol))*180/pi
ans = 10×1
-163.8309 160.1691 -127.8309 124.1691 -91.8309 88.1691 -55.8309 52.1691 -19.8309 16.1691
The root returned by exp(d1)^0.1 was the one with smallest polar angle, at 16.1691 degrees.
plot(real(xsol),imag(xsol),'o')
hold on
plot(real(exp(d1)^0.1),imag(exp(d1)^0.1),'r*')
plot(real(exp(d1*0.1)),imag(exp(d1*0.1)),'gs')
axis equal
axis square
So those are the 10 possible solutions you MIGHT have seen by your two computations. I highlighted the two solutions you did find, but any of them are theoretically valid solutions to the 10'th root way of visualizing what you were doing. That you got two different results from two different computations that are sort of similar is just life in the big city. In the end, you need to recognize that what applies for real numbers, in the form of a simple identity like:
exp(a*b) == exp(a)^b
takes on some subtle caveats once you wander into the world of complex numbers.

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!