How is (-2)^(2/3) different than ((-2)^2)^(1/3) ?

2 次查看(过去 30 天)
Hi everybody.
It's the first time I ask a question here.
I would like to understand how is that possible that the following expressions give different results:
>> (-2)^(2/3)
ans =
-0.7937 + 1.3747i
>> ((-2)^2)^(1/3)
ans =
1.5874
  2 个评论
Priya
Priya 2014-1-23
编辑:Priya 2014-1-23
According to my point of view, in the case of ((-2)^2)^(1/3), it first computes the part ((-2)^2), which gives 4. This is then calculated with ^(1/3). ie., 4^(1/3) which gives 1.5874.
So it should be (-2)^(2*1/3) which is same as (-2)^(2/3) instead of ((-2)^2)^(1/3). It's the placement of parentheses that matters.
Paulo Oliveira
Paulo Oliveira 2014-1-23
@Priya
Even so (-2)^(2/3) and ((-2)^2)^(1/3) should be the same, don't you agree?
It seems the reason has to do with the non-unique solution as pointed by Roger Stafford below.

请先登录,再进行评论。

采纳的回答

Roger Stafford
Roger Stafford 2014-1-23
编辑:Roger Stafford 2014-1-23
This seeming inconsistency is due to the fact that ideally each of these two expressions has three roots or values and these are the same values, namely the three "cube roots of unity" times the real value 2^(2/3). They are:
+2^(2/3) = 1.5874
-1/2^(1/3)+3^(1/2)/2^(1/3)*i = -0.7937 + 1.3747*i
-1/2^(1/3)-3^(1/2)/2^(1/3)*i = -0.7937 - 1.3747*i
It would generally be an inconvenience if matlab always returned all three each time, so it chooses to give what is regarded as a "principal" value and this depends on the form of the expression. In your case your two different expression forms, though equivalent mathematically, had different principal forms and thus received different values.
This is similar to the situation with 4^(1/2) which has two roots, +2 and -2. It would be inconvenient for most purposes if both were returned by matlab, so only +2 is returned. If you write it as
4^(1/2) = ((-2)*(-2))^(1/2) = ((-2)^(1/2))*((-2)^(1/2))
you can trick it into giving you -2 as the answer.

更多回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2014-1-23
编辑:Azzi Abdelmalek 2014-1-23

类别

Help CenterFile Exchange 中查找有关 Spline Postprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by