On Sat, Aug 27, 2022 at 06:53:24PM +0800, Qian Yun wrote:
> I tested some of the integrals, not all.
> 
> It seems that for integrals contain only x (no a/b), failure is caused
> by commit 1f42999f91ce516a8d027a61be4ecbf32ad2ada4 on Jun 13 2022,
> "Handle some elliptic integrals".

The actual problem is use of 'real' by integrator.  With the
attached patch I get:

(7) -> integrate(x/sqrt(1-x^3),x)

          2 weierstrassZeta(0,4,weierstrassPInverse(0,4,x))
   (7)  - -------------------------------------------------
                                 +---+
                                \|- 1
                                         Type: Union(Expression(Integer),...)

Integrator thinks that function under integral is real, and 'real'
considers result as purely imaginary, so replaces it by 0.

Unfortunately, disabling use of 'real' in integrator causes trouble
in other places.  This is similar to use of 'rootSum', once
other parts are ready we can put the patches in.

-- 
                              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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20220827151556.GA15229%40fricas.math.uni.wroc.pl.
diff --git a/src/algebra/integrat.spad b/src/algebra/integrat.spad
index 7c8f2eba..4f33a334 100644
--- a/src/algebra/integrat.spad
+++ b/src/algebra/integrat.spad
@@ -211,8 +211,8 @@ FunctionSpaceIntegration(R, F) : Exports == Implementation where
         i
 
     try_real(f : F) : F ==
-        pu : Union(F, "failed") := trappedSpadEval(real(f))$Lisp
-        pu case F => pu
+        -- pu : Union(F, "failed") := trappedSpadEval(real(f))$Lisp
+        -- pu case F => pu
         f
 
     extend_tower(lk : List(K)) : List(K) ==
diff --git a/src/algebra/irexpand.spad b/src/algebra/irexpand.spad
index 6e8fccc1..3cbe37cf 100644
--- a/src/algebra/irexpand.spad
+++ b/src/algebra/irexpand.spad
@@ -278,7 +278,7 @@ IntegrationResultRFToFunction(R) : Exports == Implementation where
       if R has imaginary : () -> R then integrate(f, x) == complexIntegrate(f, x)
       else
         integrate(f, x) ==
-          l := [mkPrim(real g, x) for g in expand(internalIntegrate(f, x), x)]
+          l := [mkPrim(g, x) for g in expand(internalIntegrate(f, x), x)]
           empty? rest l => first l
           l
 

Reply via email to