FWIW, a working workaround this interesting Maxima quirk (bug ?) is to use 
sympy, as demonstrated here 
<https://sagecell.sagemath.org/?z=eJyNj8sKgzAQRfeC_yBunKRT6oN2l18RhDYZIWLRYjN_X2NiuyiFrnLvHHImWboJCoeMthBpomGNQlWldC1Up0ZIbqFezzQxAZ2lO14kpwm9e1sftol26tprDRqdV_He2N-OzGzM8N48o8gIMw-J9-rhTOMT5tEuNwDtwk5lpQkRNX9GIWJ8qKrqUiBsXxOYddaMU_-gQeUzD3fOxW85fcspyulf-QulymS5&lang=sage&interacts=eJyLjgUAARUAuQ==>
.

HTH,
​
Le mardi 28 novembre 2023 à 16:36:30 UTC+1, Fernando Q. Gouvea a écrit :

> Yesterday I was demonstrating to my calculus class Sage's ability to 
> implement the method of Lagrange multipliers. I used a standard example, 
> putting the following code into SageMath Cell:
>
> var('x,y,l')
> f(x,y)=10*x^(1/3)*y^(2/3)
> g(x,y)=5*x-6*y
> fx=diff(f,x)
> fy=diff(f,y)
> gx=diff(g,x)
> gy=diff(g,y)
> solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))
>
> That works beautifully. Then I decided to show off Sage's powers by 
> making a little change:
>
> var('x,y,l')
> f(x,y)=10*x^(1/3)*y^(2/3)
> g(x,y)=5*x^2+6*y
> fx=diff(f,x)
> fy=diff(f,y)
> gx=diff(g,x)
> gy=diff(g,y)
> solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))
>
> SageCell now gives me a spinning symbol ("I'm working") for a while, 
> then seems to exit without any result. On my local installation (Sage 
> 9.2 on Windows) it returns an empty list, [].
>
> What is curious is that the constraint equation 5x^2 + 6y=120 is easily 
> solved for y...
>
> Questions:
>
> 1) Shouldn't SageCell output an empty list here?
>
> 2) Is this a known limitation of "solve"?
>
> Fernando
>
> PS: It seems that if I add "algorithm='sympy'" then solutions are found.
>
> -- 
> ==================================================================
> Fernando Q. Gouvea
> Carter Professor of Mathematics
> Colby College
> Mayflower Hill 5836
> Waterville, ME 04901 
> fqgo...@colby.edu http://www.colby.edu/~fqgouvea
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5a3584b1-a59b-4b58-a8a2-86a2869a40b3n%40googlegroups.com.

Reply via email to