to_poly_solve misses some solutions.



This is inspired by a problem recently posed on the sage-support Google 
mailing list (https://groups.google.com/forum/#!topic/sage-support/
OvlwzWksSyI).

Let g(t)=%e^-(t/10)-%e^-(t/2) ; we wish to find the t values maximizing g
(t) (for t>0).

Let's set up :

charpent at portable-ec:~$ maxima

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
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) display2d:false;

(%o1) false
(%i2) g(t):=%e^-(t/10)-%e^-(t/2);

(%o2) g(t):=%e^-(t/10)-%e^-(t/2)
(%i3) dg:diff(g(t),t);

(%o3) %e^-(t/2)/2-%e^-(t/10)/10
(%i4) solve(dg=0,t);

(%o4) [%e^(t/2) = 5*%e^(t/10)]

solve() does'nt know how to solve this. However, it returns an 
interesting form of the original equation. Since g(t) is real positive, 
log(t) is an increasing bijection ; therefore a(t)=b(t) <==> log(a(t)=log
(b(t). Let's try to log-transform our problem :

(%i5) e1:log(%[1]);

(%o5) t/2 = log(5*%e^(t/10))
(%i6) radcan(e1);

(%o6) t/2 = (t+10*log(5))/10
(%i7) solve(radcan(e1),t);

(%o7) [t = 5*log(5)/2]

This is consonant with a graphical reresentation of g(t) from 0 to 50 
(5*log(5)/2 is about 4). It is (relatively) easy to show that this is the 
only real root of our original equation.

Now, let's try to use to_poly solve :

(%i8) load(to_poly_solve);

Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
(%o8) "/usr/share/maxima/5.29.1/share/to_poly_solve/to_poly_solve.mac"
(%i9) %solve(dg=0,t);

log: encountered log(0).
(%o9) %union([t = 20*%i*%pi*%z11+10*(log(5)/4+%i*%pi)],
             [t = (40*%i*%pi*%z13+5*log(5))/2],
             [t = 20*%i*%pi*%z15+10*(log(5)/4-%i*%pi/2)],
             [t = 20*%i*%pi*%z17+10*(log(5)/4+%i*%pi/2)])

We obtain four families of complex roots, but *not* the real root we got 
"by hand" in our special case.

This is a problem : in our special case, we transformed an equation of 
the sum of to exponential to 0 in an equation of two exponentials. This 
special-case solution does *not* apply, for example, to a sum/difference 
of ore than two exponentials (quite easlily encoutered in a system of 
linear differential equations). Hence two questions :

1) Is that a bug in to_poly_solve ? If so, should-it be reported as such ?

2) Does it exist a symbolic method allowing to solve this kind of 
equations systems without losing solutions ? Or another workaround ?

Sincerely,
					Emmanuel Charpentier