finding arclength around a circle hangs maxima

11 views
Skip to first unread message

Jason Grout

unread,
Oct 16, 2009, 2:28:58 PM10/16/09
to sage-...@googlegroups.com
Something is seriously wrong with simple integration in 4.1.2:

sage: a=sqrt((sin(t))^2 + (cos(t))^2)
sage: integrate(a, t, 0, 2*pi) # WRONG!
pi
sage: a.simplify_full().simplify_trig()
1
sage: integrate(a.simplify_full().simplify_trig(), t, 0, 2*pi)
2*pi

Any idea what is going on?

Thanks,

Jason

ma...@mendelu.cz

unread,
Oct 16, 2009, 3:35:22 PM10/16/09
to sage-devel
To have more fun, I have this:

marik@asus-eee:/opt/sage$ ./sage
----------------------------------------------------------------------
| Sage Version 4.1.2, Release Date: 2009-10-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: t=var('t')
sage: a=sqrt((sin(t))^2 + (cos(t))^2)
sage: integrate(a, t, 0, 2*pi)
pi
sage:

And this is maxima session:

;;; Loading #P"/opt/sage/local/lib/ecl/defsystem.fas"

;;; Loading #P"/opt/sage/local/lib/ecl/cmp.fas"

;;; Loading #P"/opt/sage/local/lib/ecl/sysfun.lsp"

Maxima 5.19.1 http://maxima.sourceforge.net

Using Lisp ECL 9.8.4

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) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(1784072509+1));

<sage-display>(%o1) 0

<sage-display>(%o2) __SAGE_SYNCHRO_MARKER_1784072510

(%i3) display2d:false; domain: complex; keepfloat: true; load
(topoly_solver);

<sage-display>

(%o3) false

<sage-display>

(%o4) complex

<sage-display>

(%o5) true

<sage-display>

(%o6) "/opt/sage/local/share/maxima/5.19.1/share/contrib/
topoly_solver.mac"

(%i7) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(572821093+1));

<sage-display>

(%o7) 0

<sage-display>

(%o8) "__SAGE_SYNCHRO_MARKER_572821094"

(%i9) nolabels:true;

<sage-display>

(%o9) true

(%i10) :lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-
dabbrev x) (tex-d x '\\partial)) l r lop rop ))

0;sconcat("__SAGE_SYNCHRO_MARKER_",(86715755+1));



TEX-DERIVATIVE

(%i10) <sage-display>

(%o10) 0

<sage-display>

(%o11) "__SAGE_SYNCHRO_MARKER_86715756"

(%i12) 0;

<sage-display>

(%o12) 0

(%i13) sage0 : (((sin(t))^(2))+((cos(t))^(2)))^(1/2)$

<sage-display>

(%i14) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(1995813336+1));

<sage-display>

(%o14) 0

<sage-display>

(%o15) "__SAGE_SYNCHRO_MARKER_1995813337"

(%i16) sage1 : t$

<sage-display>

(%i17) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(1953885597+1));

<sage-display>

(%o17) 0

<sage-display>

(%o18) "__SAGE_SYNCHRO_MARKER_1953885598"

(%i19) sage2 : 0$

<sage-display>

(%i20) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(333161657+1));

<sage-display>

(%o20) 0

<sage-display>

(%o21) "__SAGE_SYNCHRO_MARKER_333161658"

(%i22) sage3 : (%pi)*(2)$

<sage-display>

(%i23) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(1111779811+1));

<sage-display>

(%o23) 0

<sage-display>

(%o24) "__SAGE_SYNCHRO_MARKER_1111779812"

(%i25) sage4 : integrate(sage0,sage1,sage2,sage3)$

<sage-display>

(%i26) kill(sage3)$kill(sage2)$kill(sage1)$kill(sage0)$kill(sage3)$kill
(sage2)$kill(sage1)$kill(sage0)$0;sconcat("__SAGE_SYNCHRO_MARKER_",
(2067936922+1));

<sage-display><sage-display><sage-display><sage-display><sage-display>

(%o30) 0

<sage-display>

(%o31) "__SAGE_SYNCHRO_MARKER_2067936923"

(%i32) sage5 : 0$

<sage-display>

(%i33) 0;sconcat("__SAGE_SYNCHRO_MARKER_",(1769152096+1));

<sage-display>

(%o33) 0

<sage-display>

(%o34) "__SAGE_SYNCHRO_MARKER_1769152097"

(%i35) sage6 : gen(sage5)$

<sage-display>

(%i36) kill(sage5)$kill(sage5)$0;sconcat("__SAGE_SYNCHRO_MARKER_",
(1390469140+1));

<sage-display><sage-display>

(%o37) 0

<sage-display>

so maxima is doing

sage0 : (((sin(t))^(2))+((cos(t))^(2)))^(1/2)$
sage1 : t$
sage2 : 0$
sage3 : (%pi)*(2)$
sage4 : integrate(sage0,sage1,sage2,sage3)

Lets try it:

----------------------------------------------------------------------
| Sage Version 4.1.2, Release Date: 2009-10-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: t=var('t')
sage: a=sqrt((sin(t))^2 + (cos(t))^2)
sage: integrate(a, t, 0, 2*pi)
pi
sage: maxima("(sage0:(((sin(t))^(2))+((cos(t))^(2)))^(1/2),sage1 : t,
sage2 : 0, sage3 : (%pi)*(2), sage4 : integrate
(sage0,sage1,sage2,sage3))")
%pi


Tests within maxima
1. maxima from debian package:
marik@asus-eee:~$ maxima --batch-string="integrate(sqrt(sin(x)^2+cos(x)
^2),x,0,2*%pi);"

Maxima 5.13.0 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
2 2
(%i1) integrate(sqrt(sin (x) + cos (x)), x, 0, 2 %pi)
(%o1) 2 %pi
marik@asus-eee:~$

2. maxima in Sage:
marik@asus-eee:/opt/sage$ ./sage
----------------------------------------------------------------------
| Sage Version 4.1.2, Release Date: 2009-10-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: maxima("integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi)")
%pi
sage:


Broken version of Maxima? Did Maxima in Sage passed tests? Maxima
commes with many tests from upstream. Have these tests been tested?

Robert

kcrisman

unread,
Oct 16, 2009, 4:00:42 PM10/16/09
to sage-devel
This was the Maxima upgrade, for sure. It is not in 4.1.1 (just
checked) and is in the latest CVS of Maxima (just checked that, too).
I can't submit a bug report to them right now - can you email their
list (I think you're on it?) and see if they know about it?

- kcrisman

Jason Grout

unread,
Oct 16, 2009, 4:23:06 PM10/16/09
to sage-...@googlegroups.com


I'm not on their list. I hope Robert Dodier or someone else sees this.

Thanks,

Jason

ma...@mendelu.cz

unread,
Oct 16, 2009, 4:44:06 PM10/16/09
to sage-devel
I am. I will write there.

Robert

ma...@mendelu.cz

unread,
Oct 16, 2009, 4:55:04 PM10/16/09
to sage-devel


On 16 říj, 22:44, "ma...@mendelu.cz" <ma...@mendelu.cz> wrote:
> I am. I will write there.
>
it is http://thread.gmane.org/gmane.comp.mathematics.maxima.general/28550
R.

Maurizio

unread,
Oct 16, 2009, 5:14:35 PM10/16/09
to sage-devel
to me, this looks like a strong encouragement to provide sage 4.1.3
with a couple of bugfixes (also considering something that could arise
from the new notebook) anytime very soon: I don't think it is a good
idea to have a release with such a serious bug, out for too long...
the problem is that I wouldn't like to switch back to an old maxima,
so we should at least wait for them fixing it... maybe we can help on
that

regards

Maurizio

ma...@mendelu.cz

unread,
Oct 16, 2009, 5:36:42 PM10/16/09
to sage-devel
A should we open trac and add test if this has been fixed?

Robert Dodier

unread,
Oct 16, 2009, 6:40:29 PM10/16/09
to sage-devel
On Oct 16, 2:23 pm, Jason Grout <jason-s...@creativetrax.com> wrote:

> I'm not on their list. I hope Robert Dodier or someone else sees this.

Probably it's best to submit Maxima bugs to the bug tracker.
http://sourceforge.net/tracker/?func=browse&group_id=4933&atid=104933

FWIW

Robert Dodier

ma...@mendelu.cz

unread,
Oct 16, 2009, 6:53:23 PM10/16/09
to sage-devel
Thanks, reported as bug No 2880797

> FWIW
>
> Robert Dodier

Jason Grout

unread,
Oct 27, 2009, 2:15:12 AM10/27/09
to sage-...@googlegroups.com


I just checked on this:

http://sourceforge.net/tracker/?func=detail&aid=2880797&group_id=4933&atid=104933

Maybe we can set an option to fix this:

"Perhaps this bug is not a new problem. The answer of Maxima depends on the
flag triginversers.

(%i36) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:true;
(%o36) %pi

(%i37) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:all;
(%o37) 2 %pi

The default value of triginverses has changed with revision 1.33 of
trigi.lisp from 'all to 'true. The bug was not visible in the past with the
standard value 'all of triginverses.

Dieter Kaiser"

Thanks,

Jason

--
Jason Grout

kcrisman

unread,
Oct 27, 2009, 8:55:36 AM10/27/09
to sage-devel
> "Perhaps this bug is not a new problem. The answer of Maxima depends on the
> flag triginversers.
>
> (%i36) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:true;
> (%o36) %pi
>
> (%i37) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:all;
> (%o37) 2 %pi
>

Okay, let's check if this can work - we would just have to pass it in
as an option when we initialize the calculus copy of Sage, which is
easy. Has this already been reported as a Sage bug?

- kcrisman

kcrisman

unread,
Oct 27, 2009, 9:21:29 AM10/27/09
to sage-devel
> Maybe we can set an option to fix this:
>
> "Perhaps this bug is not a new problem. The answer of Maxima depends on the
> flag triginversers.
>
> (%i36) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:true;
> (%o36) %pi
>
> (%i37) integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi),triginverses:all;
> (%o37) 2 %pi
>
> The default value of triginverses has changed with revision 1.33 of
> trigi.lisp from 'all to 'true. The bug was not visible in the past with the
> standard value 'all of triginverses.

Just so we know what we're getting into:

http://www.math.utexas.edu/pipermail/maxima/2008/012981.html says
that
(%i1) triginverses;
(%o1) all
(%i2) asin(sin(x));
(%o2) x
(%i3) asin(sin(x)), triginverses=true;
(%o3) asin(sin(x))

Is that going to affect any Sage stuff if we revert to 'all'?
(Presumably not, since there don't seem to have been any other
complaints about this.)

- kcrisman

kcrisman

unread,
Oct 27, 2009, 9:50:49 AM10/27/09
to sage-devel

> (%i1) triginverses;
> (%o1) all
> (%i2) asin(sin(x));
> (%o2) x
> (%i3) asin(sin(x)), triginverses=true;
> (%o3) asin(sin(x))
>
> Is that going to affect any Sage stuff if we revert to 'all'?
> (Presumably not, since there don't seem to have been any other
> complaints about this.)

Sorry for all the followups - I really want some input on this before
a change. We could also wait on the next Maxima, since there is a
patch posted on their bug tracker, though it's not merged yet, or
patch ours. Here's the true Sage effect, I think, from a general
change:

before:
sage: asin(sin(x)).simplify()
arcsin(sin(x))

after:
sage: asin(sin(x)).simplify()
x

The same would be true of simplify_full(), etc, but not of Pynac
(since it doesn't call Maxima). The patch to Maxima looks like it
only affects integration of u-substitution stuff, though I haven't
tested it.

- kcrisman

Jason Grout

unread,
Oct 27, 2009, 1:53:51 PM10/27/09
to sage-...@googlegroups.com


Actually, I misread the bug report (apparently, sourceforge lists things
with the most current thing first, so the message I thought was the
resolution was actually the initial exploration of the issue).
Karl-Dieter, do you see the patch to maxima at
http://sourceforge.net/tracker/?func=detail&aid=2880797&group_id=4933&atid=104933
(in the first comment)? That patch only affects the trig substitution,
I believe, so it's a much less drastic change than reverting
triginverses for everything. I think we ought to use the patch to
maxima, rather than setting triginverses like I implied in the above
message.

Reply all
Reply to author
Forward
0 new messages