Here are two ways to proceed. The first one gives you approximate results from which you can guess the correct solution, the second is an exact resolution. In both cases, I define $s = a^5 + b^5 + c^5$ and I try to obtain the value of $s$.
1. Using symbolic variables and solve: approximate solution
sage: var('a, b, c, s')
(a, b, c, s)
sage: eq1 = a + b + c == 3
sage: eq2 = a^2 + b^2 + c^2 == 5
sage: eq3 = a^3 + b^3 + c^3 == 7
sage: eq4 = a^5 + b^5 + c^5 == s
sage: sol = solve([eq1, eq2, eq3, eq4], [s, a, b, c])
sage: sol
[[s == (9.666666666666746 + 2.94556046220862e-14*I), a == -0.240011808699075, b == (1.620005904858813 - 0.3914357752931976*I), c == (1.620005904858815 + 0.3914357752931956*I)], [s == (9.666666666666746 - 2.94556046220862e-14*I), a == -0.240011808699075, b == (1.620005904858813 + 0.3914357752931976*I), c == (1.620005904858816 - 0.3914357752931965*I)], [s == (9.666666666666751 + 3.28070903776734e-14*I), a == (1.620005904858813 + 0.3914357752931967*I), b == (1.620005904858812 - 0.3914357752931972*I), c == (-0.2400118097109294 + 2.8091418080578e-13*I)], [s == (9.666666666666785 + 3.01612557994701e-14*I), a == (1.620005904858813 + 0.3914357752931967*I), b == (-0.2400118097176253 + 3.13587902457777e-16*I), c == (1.620005904858814 - 0.3914357752931946*I)], [s == (9.666666666666691 - 2.60902410786912e-15*I), a == (1.620005904858813 - 0.3914357752931967*I), b == (1.620005904858812 + 0.3914357752931972*I), c == (-0.2400118097145694 + 1.53912993461347e-12*I)], [s == (9.666666666666424 - 3.01370197640685e-14*I), a == (1.620005904858813 - 0.3914357752931967*I), b == (-0.2400118097176253 - 2.82969990755139e-16*I), c == (1.620005904858808 + 0.3914357752932017*I)]]
To obtain only the value of s
, you can write:
sage: [s[0] for s in sol]
[s == (9.666666666666746 + 2.94556046220862e-14*I),
s == (9.666666666666746 - 2.94556046220862e-14*I),
s == (9.666666666666751 + 3.28070903776734e-14*I),
s == (9.666666666666785 + 3.01612557994701e-14*I),
s == (9.666666666666691 - 2.60902410786912e-15*I),
s == (9.666666666666424 - 3.01370197640685e-14*I)]
From there, you can guess that the value of s
is in fact $9.6666666... = 29/3$ and try to prove it.
2. Using polynomials and Gröbner bases: exact solution
sage: R.<a,b,c,s> = QQ[]
sage: f1 = a + b + c - 3
sage: f2 = a^2 + b^2 + c^2 - 5
sage: f3 = a^3 + b^3 + c^3 - 7
sage: f4 = a^5 + b^5 + c^5 - s
sage: I = R.ideal([f1, f2, f3, f4])
sage: G = I.groebner_basis()
sage: G
[c^3 + (-3)*c^2 + 2*c + 2/3, b^2 + b*c + c^2 + (-3)*b + (-3)*c + 2, a + b + c - 3, s - 29/3]
From there you conclude that the only possibility for $s$ is $29/3$.
Of course, you can ask for more to obtain the full list of solutions :
First compute the dimension of I
:
sage: I.dimension()
0
Since it is zero, the variety (set of solutions) defined by your ideal is finite, and you can compute the full list:
sage: V = I.variety()
sage: V
[]
This means that there is no solution with all variables set to some rational. But there are solutions in the algebraic ... (more)