Ask Your Question
2

sol = solve([x^2+y^2+z^2==2, x^3+y^3+z^3==2,x^4+y^4+z^4==2], x,y,z)

asked 2023-07-29 00:37:26 +0100

wisher gravatar image

Hello, to answer a question asked on QUORA I asked SageMath to solve the following system of 3 equations with 3 unknowns.

var('x,y,z')
sol = solve([x^2+y^2+z^2==2, x^3+y^3+z^3==2, x^4+y^4+z^4==2] , X Y Z)
for s in sol:
     print s[0], s[1], s[2]

I got 9 solutions: 3 real and 6 complex.

x == 1 y == 1 z == 0
x == 0 y == 1 z == 1
x == 1.240011837821841 y == (-0.6200059048588131 + 0.3914357752931961*I) z == (-0.6200059048588134 - 0.3914357752931976*I)
x == 1.240011837821841 y == (-0.6200059048588131 - 0.3914357752931961*I) z == (-0.6200059048588134 + 0.3914357752931976*I)
x == (-0.6200059048588129 - 0.391435775293197*I) y == (-0.6200059048588129 + 0.391435775293197*I) z == 1.240011837821841
x == (-0.6200059048588129 - 0.391435775293197*I) y == (1.240011809717629 + 2.19850512568856e-15*I) z == (-0.6200059048588252 + 0.3914357752932104*I)
x == (-0.6200059048588129 + 0.391435775293197*I) y == (-0.6200059048588158 - 0.3914357752931977*I) z == (1.240011809717626 - 4.44089209850063e-16*I)
x == (-0.6200059048588129 + 0.391435775293197*I) y == (1.240011809717633 + 2.41169094738639e-14*I) z == (-0.620005904858701 - 0.3914357752932433*I)
x == 1 y == 0 z == 1

A reader answered me this: In fact, there are 15 solutions. SageMath forgets certain permutations. And it doesn't give the exact values (except for the three obvious real solutions).

Can any of you explain to me how to get all the exact solutions (with exponentials)? I thank you in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2023-07-29 08:36:28 +0100

rburing gravatar image

updated 2023-07-29 08:40:13 +0100

The solutions can all be expressed in terms of radicals:

R.<x,y,z> = QQ[]
I = R.ideal([x^2+y^2+z^2-2, x^3+y^3+z^3-2, x^4+y^4+z^4-2])
sols = I.variety(QQbar)
for sol in sols:
    print({v: sol[v].radical_expression() for v in sol})

Output:

{z: 0, y: 1, x: 1}
{z: 1, y: 0, x: 1}
{z: 1, y: 1, x: 0}
{z: -2, y: -I*sqrt(2) - 1, x: I*sqrt(2) - 1}
{z: -2, y: I*sqrt(2) - 1, x: -I*sqrt(2) - 1}
{z: -I*sqrt(2) - 1, y: -2, x: I*sqrt(2) - 1}
{z: I*sqrt(2) - 1, y: -2, x: -I*sqrt(2) - 1}
{z: -I*sqrt(2) - 1, y: I*sqrt(2) - 1, x: -2}
{z: I*sqrt(2) - 1, y: -I*sqrt(2) - 1, x: -2}
{z: (1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3) + 1/3/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3), y: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(I*sqrt(3) + 1) - 1/6*(-I*sqrt(3) + 1)/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3), x: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(-I*sqrt(3) + 1) - 1/6*(I*sqrt(3) + 1)/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)}
{z: (1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3) + 1/3/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3), y: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(-I*sqrt(3) + 1) - 1/6*(I*sqrt(3) + 1)/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3), x: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(I*sqrt(3) + 1) - 1/6*(-I*sqrt(3) + 1)/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)}
{z: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(I*sqrt(3) + 1) - 1/6*(-I*sqrt(3) + 1)/(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3), y: -1/2*(1/9*sqrt(3)*sqrt(2) + 1/3)^(1/3)*(-I*sq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

Thank you very much for your answer. I update my version of SageMath immediately.

wisher gravatar imagewisher ( 2023-07-29 10:20:07 +0100 )edit
0

answered 2023-07-29 01:03:52 +0100

Max Alekseyev gravatar image

Your Sage version is outdated (it's even Python2-based). Please update it and you'll see all 15 solutions. E.g., you can see them all in Sagecell: https://sagecell.sagemath.org/?q=qboyaw

edit flag offensive delete link more

Comments

Indeed I still work with version 7.3. I will make the transition as soon as possible to the latest version. A big thank you for your reply. Have a nice week end.

wisher gravatar imagewisher ( 2023-07-29 01:15:29 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-07-29 00:37:26 +0100

Seen: 84 times

Last updated: Jul 29 '23