rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

integrate(sin(x)/cos(x)^2,x,0,%pi/3); #1573

Closed rtoy closed 2 days ago

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:14:47 Created by *anonymous on 2005-12-06 18:46:35 Original: https://sourceforge.net/p/maxima/bugs/831


Should return 1 but returns 0 if cos(x) is declared positive. Strange enough, if cos(x) is declared zero, maxima returns the correct result.

poul.riis@skolekom.dk

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:14:48 Created by rtoy on 2006-01-28 19:23:14 Original: https://sourceforge.net/p/maxima/bugs/831/#597f


Logged In: YES user_id=28849

The hint that the result is correct if cos(x) is declared zero is key.

It seems the problem is in sin-cos-intsubs1 in defint.lisp. There's a clause there:

  \(\(not \(equal \($asksign denom\) '$zero\)\)
   0.\)

This seems bizarre. If the denom is not zero, why should it return 0? My limited understanding is that sin-cos-intsubs1 is supposed to substitute the limits of the integral into the indefinite integral. (Which, by the way is correctly computed by antideriv.)

Changing it to read (equal ($asksign denom) '$zero)) makes more sense, but I don't know about returning zero as the result. Undefined or infinity seems better, if a choice must be made.

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:14:52 Created by rtoy on 2006-02-12 16:09:08 Original: https://sourceforge.net/p/maxima/bugs/831/#9798


Logged In: YES user_id=28849

Fixed as described, but we return '$undefined instead of 0, for want of a better solution. Seems better than 0 anyway.

rtoy commented 2 days ago

Imported from SourceForge on 2024-07-04 20:14:55 Created by rtoy on 2006-02-12 16:09:08 Original: https://sourceforge.net/p/maxima/bugs/831/#b178