[sage-support] Re: solve() behavior
after solving an equation (or not) for x, I can check if the answer still contains x by ans.has(x). That should weed out any non-explicit solutions. But still: am I guaranteed for any class of equations, e.g. polynomial equations of degree <= 4, that if solve produces an empty list there really are no solutions? (I mean of course, am I guaranteed that if there are no bugs, this is true?) > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: solve() behavior
On Tuesday, February 19, 2019 at 8:56:50 AM UTC-8, Michael Beeson wrote: > > When I try to reproduce Eric's post, I get an error message about an > unexpected keyword argument > (maybe my version of Sage is too old.) But look at this: > > sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x,explicit_solutions=True) > > [1/4*I*sqrt(41) + 7/4 == -1/2*sqrt(7/2*I*sqrt(41) + 2), 1/4*I*sqrt(41) + > 7/4 == 1/2*sqrt(7/2*I*sqrt(41) + 2)] > > > That doesn't look like an "explicit solution" to me. > > How can I force solve to return only actual solutions, i.e. x = > something not containing x? > > > Here is what I see: sage: solve(2*(x+sqrt(1-x^2))-7, x) [x == -sqrt(-x^2 + 1) + 7/2] sage: solve(2*(x+sqrt(1-x^2))-7, x, explicit_solutions=True) # it can't find any explicit solutions [] sage: solve(2*(x+sqrt(1-x^2))-7, x, to_poly_solve=True) [x == -1/4*I*sqrt(41) + 7/4, x == 1/4*I*sqrt(41) + 7/4] sage: solve(2*(x+sqrt(1-x^2))-7, x, algorithm='sympy') [x == -1/4*I*sqrt(41) + 7/4, x == 1/4*I*sqrt(41) + 7/4] -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: solve() behavior
When I try to reproduce Eric's post, I get an error message about an unexpected keyword argument (maybe my version of Sage is too old.) But look at this: sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x,explicit_solutions=True) [1/4*I*sqrt(41) + 7/4 == -1/2*sqrt(7/2*I*sqrt(41) + 2), 1/4*I*sqrt(41) + 7/4 == 1/2*sqrt(7/2*I*sqrt(41) + 2)] That doesn't look like an "explicit solution" to me. How can I force solve to return only actual solutions, i.e. x = something not containing x? -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: solve() behavior
Eric's post shows me how to get that particular example solved. But my real concern is, when my code (inside some deep loop) calls solve, I want to know (a) if it returns an answer, that answer really is a solution, and (b) if it returns an empty list, there really is no solution. So this example shows that (a) is sometimes false. And when is (b) true? On Monday, February 18, 2019 at 12:56:56 PM UTC-8, Michael Beeson wrote: > > sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x) > > [x == -sqrt(-x^2 + 1) + 7/2] > > > sage: version() > > 'SageMath version 8.0, Release Date: 2017-07-21' > > > That doesn't look like a solution to me because x still appears on the > right. > > Is this the intended behavior? > > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: solve() behavior
Hi, Le lundi 18 février 2019 21:56:56 UTC+1, Michael Beeson a écrit : > > sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x) > > [x == -sqrt(-x^2 + 1) + 7/2] > > > sage: version() > > 'SageMath version 8.0, Release Date: 2017-07-21' > > > That doesn't look like a solution to me because x still appears on the > right. > > Is this the intended behavior? > > > Certainly not. Trying with algorithm='sympy' leads to two true solutions in the complex domain: sage: solve(2*(x+sqrt(1-x^2))-7,x, algorithm='sympy') [x == -1/4*I*sqrt(41) + 7/4, x == 1/4*I*sqrt(41) + 7/4] Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.