Share

Maxima -- GPL CAS based on DOE-MACSYMA

Tracker: Bugs

5 bad answer in integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi) - ID: 2880797
Last Update: Comment added ( rtoy )

integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi)

returns %pi but the result is 2*%pi

The Maxima bug database is available at
http://sourceforge.net/tracker/?atid=104933&group_id=4933&func=browse
Submit bug reports by following the 'Add new artifact' link on that page.
Please include the following build information with your bug report:
-------------------------------------------------------------

Maxima version: 5.19.1
Maxima build date: 1:42 10/16/2009
host type: i686-pc-linux-gnu
lisp-implementation-type: ECL
lisp-implementation-version: 9.8.4

-------------------------------------------------------------
The above information is also available from the Maxima function
build_info().



this bug is not in 5.13

reported at http://groups.google.cz/group/sage-devel/t/f82e24efdfe23b07

Robert Marik


Robert Marik ( robertmarik ) - 2009-10-16 22:27

5

Open

None

Nobody/Anonymous

Lisp Core - Integration

None

Public


Comments ( 3 )




Date: 2009-11-05 17:55
Sender: rtoy

This looks like a good solution. But is it too broad? Are there cases in
trigint where triginverses set to $all would be wrong? Maybe a more
careful solution that only sets it when we use the tan(x/2) substitution
would be better?

I couldn't see any cases where it would produce incorrect results.


Date: 2009-10-17 21:45
Sender: andrejvProject AdminAccepting Donations

The problem comes from

(%i1) integrate(sqrt(sin(x)^2+cos(x)^2), x);
(%o1) atan(tan(x))

This integral is done with substitution (tan(x/2)) and we need to make
sure that atan(tan(x))=x when we back-substitute.

Here is a simple patch which fixes the problem:

Index: sin.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/sin.lisp,v
retrieving revision 1.51
diff -u -r1.51 sin.lisp
--- sin.lisp 18 Aug 2009 16:59:37 -0000 1.51
+++ sin.lisp 17 Oct 2009 21:33:54 -0000
@@ -1503,7 +1503,7 @@
getout
(setq y (list '(mtimes) *yy* *yz*))
get2 (setq y (simplify y))
- (return (substint repl 'x (integrator y 'x)))))
+ (return (let (($triginverses '$all)) (substint repl 'x (integrator y
'x))))))

(defmvar $integration_constant_counter 0)
(defmvar $integration_constant '$%c)



Date: 2009-10-16 22:57
Sender: crategus

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


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.