rtoy / maxima

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

nointegrate isn't documented & doesn't do what it says #1343

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 09:53:52 Created by willisbl on 2021-08-18 10:37:21 Original: https://sourceforge.net/p/maxima/bugs/3829


The option variable nointegrate isn't documented and it doesn't do what the source code comment says it does. The source code comment says:

nointegrate is a macsyma level flag which inhibits indefinite integration

But in this context, "inhibits" is a weasel word.

Example: Based on the name of this option variable, a user might expect a nonform for %o2>

(%i1)   block([nointegrate : false], integrate(mod(x,4),x,0,1));
(%o1)   1/2

(%i2)   block([nointegrate : true], integrate(mod(x,4),x,0,1));
(%o2)   1/2

The only difference is that the in the second case, Maxima attempts a more careful examination of the integrand using initial-analysis and in the first case, Maxima trusts that the antiderivative is valid on the integration interval. But there is a long list of functions (mexpt mplus mtimes %sin ...) that also alter whether Maxima does the more careful examination.

It's likely good that nointegrate is undocumented--we might be better off funneling all integrations through initial-analysis and effectively ending the need for nointegrate

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 09:53:53 Created by robert_dodier on 2021-09-16 19:26:00 Original: https://sourceforge.net/p/maxima/bugs/3829/#975c


Agreed that we should look at nuking nointegrate, assuming it's either always false or always true.

One can try

nointegrate: true;
:lisp (setf (gethash '$nointegrate *variable-initial-values*) t)

and then run_testsuite() to see if there's any change in expected results.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 09:53:56 Created by robert_dodier on 2021-09-16 19:26:45 Original: https://sourceforge.net/p/maxima/bugs/3829/#8cc9