As Martin recently pointed out, this integration is not continuous:
INT((2560*x^3 - 400*x^2 - 576*x - 84)/(320*x^4 + 80*x^3 - 12*x^2
+ 24*x + 9), x) = 2*LN(320*x^4 + 80*x^3 - 12*x^2 + 24*x + 9)
+ 2*SQRT(11)*ATAN(SQRT(11)*(10*x + 3)/(80*x^2 + 10*x - 9))
After some debugging, I find out the bug is in irexpand.spad:
in function "ilog", uses 'k := "max"/l' to choose the main variable,
in this example, it should be 'x'. But there are also 'sqrt(11)' in 'l',
causes 'k' to be 'sqrt(11)' instead of 'x'.
I think this patch fixes this issue, using 'find' and 'symbolIfCan'
to make sure 'k' is the main variable symbol.
I think it will be better to add some comments to this part,
such as "k is the main variable of the integrand".
diff --git a/src/algebra/irexpand.spad b/src/algebra/irexpand.spad
index 6e43ea41..652bf0ee 100644
--- a/src/algebra/irexpand.spad
+++ b/src/algebra/irexpand.spad
@@ -112,9 +112,9 @@
ilog(a, b, lk) ==
l := setDifference(setUnion(variables numer a, variables numer b),
setUnion(lk, setUnion(variables denom a, variables denom b)))
- empty? l => tantrick(a, b)
- k := "max"/l
- ilog0(a, b, numer univariate(a, k), numer univariate(b, k), k::F)
+ k := find((t : K) : Boolean +-> symbolIfCan t case Symbol, l)
+ k case "failed" => tantrick(a, b)
+ ilog0(a, b, numer univariate(a, k), numer univariate(b, k), k::K::F)
-- transforms i log((a + i b) / (a - i b)) into a sum of real
-- arc-tangents using Rioboo's algorithm
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.