1 | initial version |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that make the SAGE answer "better" than the real answer you expect. It has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. That's a bit technical, so look at the simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive: i, i^2, i^3, i^4 gives i, -1, -i, 1; all the roots were found knowing i. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1. SAGE has given you the primitive element needed to create all the answers.

2 | No.2 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that ~~make ~~helps me to understand why the SAGE answer "better" than the real answer you ~~expect. It ~~expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. ~~That's ~~Okay, that's a bit technical, so look at ~~the ~~this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive: i, i^2, i^3, i^4 gives i, -1, -i, 1; all the roots were found knowing i. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given will.

3 | No.3 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that helps me to understand why the SAGE answer could be considered "better" than the real answer you expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. Okay, that's a bit technical, so look at this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is ~~primitive: ~~primitive because: i, i^2, i^3, i^4 gives i, -1, -i, ~~1; ~~1 which is all the roots ~~were found knowing i. ~~of the answer. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always ~~1. ~~1 and it doesn't work with -1 since -1, (-1)^2, (-1)^3, (-1)^4 gives -1,1,-1,1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given ~~will.~~is a primitive root that will create the other roots.

4 | No.4 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that helps me to understand why the SAGE answer could be considered "better" than the real answer you expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. Okay, that's a bit technical, so look at this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive because: i, i^2, i^3, i^4 gives i, -1, -i, 1 which is all the roots of the answer. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1 and it doesn't work with -1 since -1, (-1)^2, (-1)^3, (-1)^4 gives -1,1,-1,1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given is a primitive root that will create the other ~~roots.~~roots. It's a little bit more complicated for your example as the modulus of your number is not 1 and your number is negative but same idea is in play. Some of it is covered in precalculus when you get to DeMoivre's Theorem.

5 | No.5 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that helps me to understand why the SAGE answer could be considered "better" than the real answer you expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. Okay, that's a bit technical, so look at this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive because: i, i^2, i^3, i^4 gives i, -1, -i, 1 which is all the roots of the answer. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1 and it doesn't work with -1 since -1, (-1)^2, (-1)^3, (-1)^4 gives -1,1,-1,1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given is a primitive root that will create the other roots. It's a little bit more complicated for your example as the modulus of your number is not 1 and your number is negative but same idea is in play. Some of it is covered in precalculus when you get to DeMoivre's ~~Theorem.~~Theorem. There is a post at math stack exchange here relevant to your problem if you want a little more math.

6 | No.6 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that helps me to understand why the SAGE answer could be considered "better" than the real answer you expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. Okay, that's a bit technical, so look at this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive because: i, i^2, i^3, i^4 gives i, -1, -i, 1 which is all the roots of the answer. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1 and it doesn't work with -1 since -1, (-1)^2, (-1)^3, (-1)^4 gives -1,1,-1,1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given is a primitive root that will create the other roots. It's a little bit more complicated for your example as the modulus of your number is not 1 and your number is negative but same idea is in play. Some of it is covered in precalculus when you get to DeMoivre's Theorem. There is a post at math stack exchange ~~here relevant to your problem if you want a little more math.~~

7 | No.7 Revision |

I don't have knowledge of the coding decisions in SAGE but I've got some math background that helps me to understand why the SAGE answer could be considered "better" than the real answer you expected. In math terms it has to do with the fact that the nth roots of unity form a group and some of the answers are generators for the group (primitive elements). That is, knowing a generator gets you all the answers. Okay, that's a bit technical, so look at this simpler problem x^4=1. There 4 answers: 1, -1, i, -i. The root i is primitive because: i, i^2, i^3, i^4 gives i, -1, -i, 1 which is all the roots of the answer. This doesn't work with 1 since 1, 1^2, 1^3, 1^4 is always 1 and it doesn't work with -1 since -1, (-1)^2, (-1)^3, (-1)^4 gives -1,1,-1,1. SAGE has given you the primitive element needed to create all the answers. Your answer -cuberoot(3) won't generate the other 2 answers as real number times real number is always a real number. The answer SAGE has given is a primitive root that will create the other roots. It's a little bit more complicated for your example as the modulus of your number is not 1 and your number is negative but same idea is in play. Some of it is covered in precalculus when you get to DeMoivre's Theorem. There is a post at math stack exchange here relevant to your problem if you want a little more math.

**EDIT:** Based on Sebastien's comment below, I dusted off a book on complex number theory to find that, for nth root of a complex number the unique nth root is defined to be when k=0 in the formula for the nth roots and is called the **principal nth root**. So for z^3=3, r=cuberoot(3) and theta = 0 (the angle used in polar form representation of 1) so the formula for the roots is cuberoot(3)cis((0+2kpi)3) = cuberoot(3) cis(0), cuberoot(3) cis(2pi/3), cuberoot(3)cis(4pi/3). For z^3=-3, r=cuberoot(3), but now theta = pi so the formula for the roots is cuberoot(3)cis((pi+2kpi)/3)= cuberoot(3)cis(pi/3), cuberoot(3)cis(pi), cuberoot(3)cis(5pi/3). So perhaps SAGE is giving the princpal root which is then used to get the rest?

8 | No.8 Revision |

**EDIT:** Based on Sebastien's comment below, I dusted off a book on complex number theory to find that, for nth root of a complex number the unique nth root is defined to be when k=0 in the formula for the nth roots and is called the **principal nth root**. So for z^3=3, r=cuberoot(3) and theta = 0 (the angle used in polar form representation of 1) so the formula for the roots is cuberoot(3)cis((0+2kpi)3) = cuberoot(3) cis(0), cuberoot(3) cis(2pi/3), cuberoot(3)cis(4pi/3). For z^3=-3, r=cuberoot(3), but now theta = pi so the formula for the roots is cuberoot(3)cis((pi+2kpi)/3)= cuberoot(3)cis(pi/3), cuberoot(3)cis(pi), cuberoot(3)cis(5pi/3). So perhaps SAGE is giving the princpal root which is then used to get the rest?

9 | No.9 Revision |

**EDIT:** Based on Sebastien's comment below, I dusted off a book on complex number theory to find that, for nth root of a complex number the unique nth root is defined to be when k=0 in the formula for the nth roots and is called the **principal nth root**. So for z^3=3, r=cuberoot(3) and theta = 0 (the angle used in polar form representation of 1) so the formula for the roots is cuberoot(3)cis((0+2kpi)3) = cuberoot(3) cis(0), cuberoot(3) cis(2pi/3), cuberoot(3)cis(4pi/3). For z^3=-3, r=cuberoot(3), but now theta = pi so the formula for the roots is cuberoot(3)cis((pi+2kpi)/3)= cuberoot(3)cis(pi/3), cuberoot(3)cis(pi), cuberoot(3)cis(5pi/3). So perhaps SAGE is giving the princpal root which is then used to get the ~~rest?~~rest via the formula?

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.