integration gets stuck on equivalent expressions

Bugs

Modérateur : xcasadmin

dimpase
Messages : 26
Inscription : mer. oct. 24, 2018 9:58 am

integration gets stuck on equivalent expressions

Message par dimpase » mar. janv. 12, 2021 12:46 pm

here the transformation (a/b)^t -> a^t/b^t, for t=5/2, leads to divergent behavours:

Code : Tout sélectionner

4>> integrate(x^(5/2)/(b*x+a)^(5/2),x)
2*(2*((9*b^4*a*1/36/b^5/a*sqrt(x)*sqrt(x)+60*b^3*a^2*1/36/b^5/a)*sqrt(x)*sqrt(x)+45*b^2*a^3*1/36/b^5/a)*sqrt(x)*sqrt(a+b*x)/(a+b*x)^2+10*a/4/b^3/sqrt(b)*ln(abs(sqrt(a+b*x)-sqrt(b)*sqrt(x))))
// Time 0.04
5>> integrate((x/(b*x+a))^(5/2),x)
Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):
Check [abs(x*b+a)]
here reordering terms in the product apparently invokes quite different code paths, the 1st much more efficient:

Code : Tout sélectionner

0>> integrate(exp(-b*x-a)*(b*x+a)^4*(d*x+c)^3,x)
Done
// Time 0.01
1>> integrate((b*x+a)^4*(d*x+c)^3*exp(-b*x-a),x)
^CCtrl-C pressed (pid 21656)
Stopped by user interruption. Error: Bad Argument Value

Evaluation time: 17.39
"Stopped by user interruption. Error: Bad Argument Value"
// Time 17.39
This is a selection of examples from https://trac.sagemath.org/ticket/31222 (done with the current Sage's giac).

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: integration gets stuck on equivalent expressions

Message par parisse » mar. janv. 12, 2021 7:33 pm

The path depends indeed on the input format: the reason is that the algorithm will try some strategies like detecting F(u)*u' form, and u will be formed from the input.
I'll have a look if I can find some strategies to improve the algorithm for your inputs, but integration is a highly sensitive area, I'm therefore very conservative with changes, being stuck is not as critical as returning something wrong.

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: integration gets stuck on equivalent expressions

Message par parisse » mar. janv. 12, 2021 7:56 pm

Second example was indeed a bug, now fixed.
https://dev.geogebra.org/trac/changeset/69729/

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: integration gets stuck on equivalent expressions

Message par parisse » jeu. janv. 14, 2021 2:54 pm

Both problems are now fixed, up to date source is 1.6.0-47.

Répondre