oldk1331 wrote:
> 
> Some faulty integration:
> 
> integrate(a^(1/4)/(x^8-1),x)
> -- following examples are from mapleok.input
> in1867a:=integrate(1/(z^2-1)*(1-(I*z)^(1/2))^(1/2), z)
> in1869a:=integrate(1/(z^2-1)*(1-1/(I*z)^(1/2))^(1/2), z)
> in1870a:=integrate(1/(z^2-1)/(1+(I*z)^(1/2))^(1/2), z)
> 
> They are returning 0, which is obviously incorrect.
> 
> Also
> in1724a:=integrate(-z^2/(z^2-1)*(1-(I*z)^(1/2))^(1/2), z)
> is wrong, although its return value is not 0.
> 
> 
> The problem happens in "pairsum" in irexpand.spad.
> 
> This "pairsum" function tries to avoid cases like both
> x^(1/n) and (-x)^(1/n) (where n is even) appears in result.
> 
> Take "integrate(a^(1/4)/(x^8-1),x)" for example, in order to
> solve "?^4+a/4096" appeared in
>     "split internalIntegrate(a^(1/4)/(x^8-1),x)",
> "lg2func" uses "zeroOf" to introduce (-a)^(1/4) which causes
> "pairsum" to return empty result.
> 
> I suggest:
> 
> 1. Add a warning/error in "pairsum" when it tries to return empty.
> 2. We can handle cases like "?^4+a" "?^4+a*?^2+b" in "lg2func" better.

First, 'zeroOf' should be used only when we know that polynomial
is irreducible.  Unfortunatly, current "lg2func" has too little
information to do this correctly.  AFIACS instead of current
"lg2func" and friends we should use a variant of 'normalize'.
And we need to extend 'normalize' so that it looks at algebraic
dependencies.  Anything less is just a temporary stopgap.

Real bug above is that we can not expand terms separately.
Concerning "pairsum": it should go away.  I with attached
patch I get:

(1) -> integrate(a^(1/4)/(x^8-1),x)

   (1)
                               4+-+
           --+                x\|a  - 8 %E
           >           %E log(------------)
           --+                    4+-+
            4                     \|a
     4096 %E  - a = 0
   + 
                               4+-+
           --+                x\|a  - 8 %F
           >           %F log(------------)
           --+                    4+-+
            4                     \|a
     4096 %F  + a = 0
                                         Type: Union(Expression(Integer),...)

Unfortunatly, this causes troubles for definite integrator.
Basically, we need to teach 'limit' how to handle 'rootSum'.

-- 
                              Waldek Hebisch

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/E1hmeWE-0003fj-LL%40hera.math.uni.wroc.pl.
For more options, visit https://groups.google.com/d/optout.
--- ../ax-build128/src/algebra/IR2F.spad        2019-06-16 14:23:33.853365732 
+0000
+++ IR2F.spad   2019-07-14 14:20:49.497966525 +0000
@@ -151,16 +151,12 @@
       zero?(d := degree(p := lg.coeff)) => error "poly has degree 0"
       (d = 1) => [linear(p, lg.logand)]
       d = 2  => quadratic(p, lg.logand, x)
-      odd? d and
-        ((r := retractIfCan(reductum p)@Union(F, "failed")) case F) =>
-            pairsum([cmplex(alpha := rootSimp zeroOf p, lg.logand)],
-                    lg2func([lg.scalar,
-                     (p exquo (monomial(1, 1)$UP - alpha::UP))::UP,
-                      lg.logand], x))
       [lg2cfunc lg]
 
     lg2cfunc lg ==
-      +/[cmplex(alpha, lg.logand) for alpha in zerosOf(lg.coeff)]
+        s := new()$Symbol
+        ss := s::F
+        rootSum(ss*log((lg.logand)(ss)), lg.coeff, s)
 
     mkRealFunc(l, x) ==
       ans := empty()$List(F)

Reply via email to