FW: [ maxima-Bugs-1051437 ] Trig integral error



Raymond Toy <raymond.toy@ericsson.com> writes:

[The integral of
   2*COT(x)^2*COS(2*x)/(CSC(2*x)+COT(2*x));
is wrong]

>     David> This bug is annoying me enough to want to try and fix it.  
>     David> Any thoughts on where to start looking?
>
> integrate calls sinint in sin.lisp.

Actually, the integral is solved by RISCHINT and friends, who
EXPONENTIALIZE the integrand, so that it is amenable to the
hyperexponential case of the Risch algorithm (that is, things should
roughly correspond to what M. Bronstein describes in ch. 5.9 of his
Symbolic Integration I).  The problem is that at this point Laurent
polynomials (in %e^(%i*x), in this case) are needed and the author of
our implementation apparently assumed that negative exponents in CRE
representations were OK.  Just trace RISCHADD to make sense of this
explanation.  Also, a simpler example of the same bug is
risch(%e^x+%e^(-x)+1,x).

Indeed, most of the basic code we need does work for negative
exponents as well, so I am thinking of a simple-minded fix like

http://members.inode.at/wjenkner/maxima/rat3a.lisp.diff

For testing purposes, here's some code for generating such beasts from
the Maxima top-level (of course, many things, e.g. RATDIFF, won't work
correctly with them, but the aim is to make work everything needed for
RISCHINT)

http://members.inode.at/wjenkner/maxima/polthru.lisp

Please note that all of this is very tentative at the moment.

Wolfgang