Tuesday, September 12, 2006

(-1)^(1/3)=0.5000 + 0.8660i ?

This time, I meet another problem about math operation in software.
In matlab, when you try
(-1)^(1/3)
What result do we get. It is not -1 but 0.5000 + 0.8660i
You need to use nthroot(-1,3) to get -1.

This time, excel gives me the answer I want.

I am so frustrated now. This time I use more than 4 hours to debug my program which contains similar operations in my matlab code.

Do I know too little about basic math or Matlab provides too much.

2 comments:

Anonymous said...

I guess matlab is right, if you consider your problem in the comlex number field. However, Excel is really problematic, given the solution it provides today and the previous case.

Let z= 1/2 + sqrt(3)/2 i,

Then z^3 = -1

Ying said...

But let's consider (-1)^(1/5) in complex field, it should have 5 roots. How can know from the Matlab that which one it returns. Is any rule?