   Order of operations for fractional indices
  Hi guys.Working on a project where the motion of 2 particles on a screen is modeled by y1 = 7 * x^(2/3) andy2 = 2 / y1, i.e y2 = 2 / (7 * x^(2/3))And it occurred to me that I can get either a real or complex answer depending on the order in which I evaluate this expression into code.For example, Suppose x = -2If I do the squared first,y1 = 7 * 4^(1/3)But if I do it after, ((-2)^(1/3))^2 = some complex number....So what is the order of operations for fractional indices in a general sense? Do I follow the order that gives me the real number?   
  They are both correct solutions. In fact, there is a third solution also which is the complex conjugate of your complex solutions. Read some here about the three solutions to the cube root.The relationship between the three solutions is that they all have the same magnitude, and are evenly spaced on a circle centered at the origin in the complex plane. Thus, they are separated by 120 degrees.   ;Quote:Original post by Brother BobThey are both correct solutions. In fact, there is a third solution also which is the complex conjugate of your complex solutions. Read some here about the three solutions to the cube root.The relationship between the three solutions is that they all have the same magnitude, and are evenly spaced on a circle centered at the origin in the complex plane. Thus, they are separated by 120 degrees.I see. Maths is really interesting!. So does that imply that y1 = 7 * x^(2/3) is continuous for (-infinity, 0) U (0, infinity) ? not just (0, infinity) ?;  Not sure about continuity, but it is defined, and has three solutions, for all values as long as you consider complex values. If you want some particular principal value (for example, the square root has two roots but only the positive root for positive inputs are commonly considered the principal root, which is what sqrt() returns).The cube root for a real input will always have a real root, so perhaps this is the root you're after. If so, make sure this is the root you calculate for any input.   ;Quote:Original post by FirecoreI see. Maths is really interesting!. So does that imply that y1 = 7 * x^(2/3) is continuous for (-infinity, 0) U (0, infinity) ? not just (0, infinity) ?You have to be careful with these things. One can look at `7*x^(2/3)' as a multi-valued holomorphic function in the complex plane, with a branch point at 0. If you now restrict yourself to the negative reals, you can find three continuous functions that assign a complex number to each negative real.These things are tricky and hard to formalize, but there is a beautiful theory behind these objects.