(%i2) integrate (cos(2*x) * 'diff (f(x), x, 1), x);
new-var-16771
diff: second argument must be a variable; found ─────────────
2
Observed in current version (be9074f).
debugmode(true) and then trying again, and then control-C at the debugger prompt, and then looking at a Lisp stack trace shows the error is coming out of the Risch code, but I think the actual error is earlier -- looks like some function, maybe MONSTERTRIG, not sure, has tried to make a change of variable but the diff is handled incorrectly.
This is probably something I did while trying to remove/reduce the number of special variables.
Oh, wait. This might be older than that. Maxima 5.45.1 produces the same thing.
Probably caused by [4c9c1efb86] from me from 2007-01-19 where we have this bit fo code that does the substitution in monstertrig:
I notice that
changevarhas a similar problem:If I comment out the
whenblock at the beginning ofmonstertrig, this integral now just returns the nounform. And the comment about integrals ofx*sin(n*x)taking longer and longer doesn't seem to be true anymore. The commit log for [4c9c1e] saysI tried with n=10 and100, which take 0 time. n=1000 takes 0.02 sec. n=10000 takes 0.01 sec. I guess this is all in the noise.
Too bad SF changed bug trackers because I have no idea what bug 1631094 really says.
Related
Commit: [4c9c1e]
Last edit: Robert Dodier 2024-01-30
Ray, thanks for looking into it. SF still recognizes old bug numbers if you paste it into a suitable URL, e.g.
http://sourceforge.net/tracker/?func=detail&atid=104933&aid=1631094&group_id=4933which redirects to bug #1053, the bug number itself being theaid=part.OK by me to revert the previous fix -- looks like
sin(<literal integer>*x)is being handled by some different path now; PCOEFADD and PEXPT (mentioned in bug #1053) aren't called, and even for fairly large integers, e.g.,it returns immediately, so it seems unlikely there is any iteration going on.
I guess
changevarhas its own change of variable bug related todiff-- probably it needs its own bug report.Oh, I didn't know you could still get the old bug number. There are quite a few places in the code (and tests) that reference the old bug numbers. These should be fixed. And maybe a link instead of just listing a bug number.
Fixed in [63b1b1d7124cb5d5441023d7417fcc351f88bc24]
We basically removed the old substitution code that doesn't seem to be needed anymore. And added a simple test for this.
Related
Commit: [63b1b1]