Sage: Ticket #8862: solve misses some solutions in a certain nonlinear system
https://trac.sagemath.org/ticket/8862
<table class="wiki">
<tr>We search the critical points of the function x> (x<strong>2 + y</strong>2)<sup>x
</tr></table>
</sup><p>
This function has four critical points : ±(0,1) and ±(1/e,0)
</p>
<p>
However the function solve can not find any of this.
</p>
<p>
More, solve returns (0,0) which is not a critical point since f is not differentiable at (0,0) !
</p>
<pre class="wiki"> sage: var('x y')
sage: f(x,y) = (x^2 + y^2)^x
sage: solve([diff(f(x,y), x), diff(f(x,y), y)], x, y)
[[x == 0, y == 0]]
</pre>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/8862
Trac 1.1.6zimmermaMon, 03 May 2010 20:44:26 GMTpriority, milestone, type changed; author deleted
https://trac.sagemath.org/ticket/8862#comment:1
https://trac.sagemath.org/ticket/8862#comment:1
<ul>
<li><strong>priority</strong>
changed from <em>minor</em> to <em>major</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-4.4.2</em> to <em>sage-4.4.1</em>
</li>
<li><strong>type</strong>
changed from <em>enhancement</em> to <em>defect</em>
</li>
<li><strong>author</strong>
<em>Alexandre Casamayou</em> deleted
</li>
</ul>
TicketburcinTue, 04 May 2010 23:39:39 GMTcc set
https://trac.sagemath.org/ticket/8862#comment:2
https://trac.sagemath.org/ticket/8862#comment:2
<ul>
<li><strong>cc</strong>
<em>kcrisman</em> <em>robert.marik</em> <em>jason</em> added
</li>
</ul>
<p>
What is the expected improvement in this ticket?
</p>
<p>
The <code>solve()</code> function in Sage is just a wrapper around maxima for now. In this case we just return the result from maxima.
</p>
<p>
There are two problems here:
</p>
<ul><li>maxima's solve() cannot handle the given input, probably symbolic exponents defeat it
</li><li>maxima's solve() can return undefined points as output (<a class="needs_info ticket" href="https://trac.sagemath.org/ticket/2617" title="defect: solve() can return undefined points as "solutions" (needs_info)">#2617</a>)
</li></ul><p>
If this ticket is about improving the capabilities of solve to handle the given input properly, this is an enhancement request. Do we know of any algorithm that will help with this?
</p>
<p>
Otherwise, this ticket is a duplicate of <a class="needs_info ticket" href="https://trac.sagemath.org/ticket/2617" title="defect: solve() can return undefined points as "solutions" (needs_info)">#2617</a>.
</p>
<p>
Comments?
</p>
TicketzimmermaWed, 05 May 2010 06:47:36 GMT
https://trac.sagemath.org/ticket/8862#comment:3
https://trac.sagemath.org/ticket/8862#comment:3
<p>
the issue here is not only that Sage returns undefined points (which indeed duplicates <a class="needs_info ticket" href="https://trac.sagemath.org/ticket/2617" title="defect: solve() can return undefined points as "solutions" (needs_info)">#2617</a>) but
that it fails to find the following (trivial) solutions, which is a defect:
</p>
<pre class="wiki">sage: sys=[diff(f(x,y), x), diff(f(x,y), y)]
sage: map(lambda s: s.subs(x=0,y=1),sys)
[0, 0]
sage: map(lambda s: s.subs(x=0,y=-1),sys)
[0, 0]
sage: map(lambda s: s.subs(x=1/e,y=0),sys)
[0, 0]
sage: map(lambda s: s.subs(x=-1/e,y=0),sys)
[0, 0]
</pre><p>
For example Maple finds:
</p>
<pre class="wiki">> f := (x,y) -> (x^2 + y^2)^x:
> solve({diff(f(x,y), x), diff(f(x,y), y)}, {x, y}, Explicit=true);
exp(1) exp(1)
{x = 0, y = 1}, {x = 0, y = -1}, {x = - ------, y = 0}, {x = ------, y = 0}
exp(2) exp(2)
</pre><p>
When some solutions are lost, at least a warning should be issued.
</p>
TicketburcinThu, 06 May 2010 17:07:43 GMT
https://trac.sagemath.org/ticket/8862#comment:4
https://trac.sagemath.org/ticket/8862#comment:4
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/8862#comment:3" title="Comment 3">zimmerma</a>:
</p>
<blockquote class="citation">
<p>
the issue here is not only that Sage returns undefined points (which indeed duplicates <a class="needs_info ticket" href="https://trac.sagemath.org/ticket/2617" title="defect: solve() can return undefined points as "solutions" (needs_info)">#2617</a>) but
that it fails to find the following (trivial) solutions, which is a defect:
</p>
</blockquote>
<p>
<snip>
</p>
<blockquote class="citation">
<p>
When some solutions are lost, at least a warning should be issued.
</p>
</blockquote>
<p>
I don't think we can get that information out of maxima. Can someone more experienced in maxima comment on this? Or ask the maxima developers what they think about this problem?
</p>
<p>
Another option is to take this as an opportunity to start implementing some native <code>solve()</code> functionality in Sage. I have no idea how to (more or less algorithmically) find a solution to this system though. I'd appreciate any pointers.
</p>
TicketkcrismanWed, 16 Mar 2011 16:10:22 GMTsummary, upstream changed
https://trac.sagemath.org/ticket/8862#comment:5
https://trac.sagemath.org/ticket/8862#comment:5
<ul>
<li><strong>summary</strong>
changed from <em>failing resolution of a nonlinear system by solve</em> to <em>solve misses some solutions in a certain nonlinear system</em>
</li>
<li><strong>upstream</strong>
changed from <em>N/A</em> to <em>Reported upstream. Little or no feedback.</em>
</li>
</ul>
<pre class="wiki">Maxima 5.23.2 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) solve([(2*x^2/(x^2 + y^2) + log(x^2 + y^2))*(x^2 + y^2)^x,2*x*y*(x^2 + y^2)^(x - 1)],[x,y]);
(%o1) [[x = 0, y = 0]]
</pre><p>
So still present in 4.7.alpha1.
</p>
<p>
This is a pretty straightforward Maxima bug/enhancement need.
</p>
<p>
The issue about it not being a critical point is irrelevant, since this is exactly equivalent to the uninterpreted
</p>
<pre class="wiki">solve([(2*x^2/(x^2 + y^2) + log(x^2 + y^2))*(x^2 + y^2)^x,2*x*y*(x^2 + y^2)^(x - 1)],[x,y])
</pre><p>
So the relevant problem is that it's returning something not in the domain of the functions in question, which is indeed a problem. In addition to not finding other solutions.
</p>
<p>
This is now Maxima bug <a class="ext-link" href="https://sourceforge.net/tracker/?func=detail&aid=3216684&group_id=4933&atid=104933"><span class="icon"></span>3216684</a>.
</p>
TicketroedThu, 22 Mar 2012 18:53:06 GMTstopgaps set
https://trac.sagemath.org/ticket/8862#comment:6
https://trac.sagemath.org/ticket/8862#comment:6
<ul>
<li><strong>stopgaps</strong>
set to <em>#12730</em>
</li>
</ul>
TicketroedFri, 01 Jun 2012 17:51:42 GMTupstream changed
https://trac.sagemath.org/ticket/8862#comment:7
https://trac.sagemath.org/ticket/8862#comment:7
<ul>
<li><strong>upstream</strong>
changed from <em>Reported upstream. Little or no feedback.</em> to <em>Reported upstream. No feedback yet.</em>
</li>
</ul>
TicketjdemeyerTue, 13 Aug 2013 15:35:53 GMTmilestone changed
https://trac.sagemath.org/ticket/8862#comment:8
https://trac.sagemath.org/ticket/8862#comment:8
<ul>
<li><strong>milestone</strong>
changed from <em>sage-5.11</em> to <em>sage-5.12</em>
</li>
</ul>
Ticketvbraun_spamThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/8862#comment:9
https://trac.sagemath.org/ticket/8862#comment:9
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/8862#comment:10
https://trac.sagemath.org/ticket/8862#comment:10
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/8862#comment:11
https://trac.sagemath.org/ticket/8862#comment:11
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
TicketmafraFri, 07 Oct 2016 23:04:10 GMT
https://trac.sagemath.org/ticket/8862#comment:12
https://trac.sagemath.org/ticket/8862#comment:12
<p>
Just a random comment: sympy can solve this. I tested it in the 'live shell' in their webpage:
</p>
<pre class="wiki">solve([(x**2 + y**2)**x*(2*x**2/(x**2 + y**2) + log(x**2 + y**2)),2*(x**2 + y**2)**(x - 1)*x*y],x,y)
[(0,−1),(0,1),(−1/e,0),(1/e,0)]
</pre><p>
(I edited the output because copy&paste mangled it).
</p>
<p>
It would be nice to have an 'algorithm=sympy' option to solve(). It seems that nobody is working in the Maxima bug.
</p>
Ticket