On Wed, Jan 28, 2026 at 05:10:53AM -0800, Fabian wrote:
> Kurt: complexNumeric eval(J,x=1/2) also gives approximately 0, when I 
> include your code in a Sage code and run it in the SageMathCell. With 
> I:=complexIntegrate(acos(x^2),x) the following line gives almost 0:
> complexNumeric eval(D(I,x)+acos(x^2),x=1/2)
> This suggests that D(I,x)=-acos(x^2) . This differs from the correct 
> expression acos(x^2) by a sign. I suspect that the mistake comes from 
> choosing wrong branches of the logarithm and square root function.

Note that in symbolic computation branches have "equal rights".
More precisly, Galois theory say that branches are indistinguishable
in algebraic way.  That is numeric computation which makes choice
of branches.

One, essentially unavoidable trouble here is definiton of elliptic
integrals: they are defined using product of roots, while algebraic
function needed to complete your integral has a single root:

(47) -> acos(x^2) - D(x*acos(x^2), x)

                2
             2 x
   (47)  -----------
          +--------+
          |   4
         \|- x  + 1
                                                    Type: Expression(Integer)
(49) -> D(-2*ellipticF(x, -1) + 2*ellipticE(x, -1), x)

                    2
                 2 x
   (49)  --------------------
          +--------+ +------+
          |   2      | 2
         \|- x  + 1 \|x  + 1
                                                    Type: Expression(Integer)

Different trouble is FriCAS generates another expression for integral,
which needs complex numbers for real x in (-1, 1) and numeric
evaluation chooses wrong branches.  This in general is unsolvable
problem, but in simple cases like this FriCAS should produce version
above and not the complex one.

-- 
                              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 visit 
https://groups.google.com/d/msgid/fricas-devel/aYFLi0xvg3YJ83B2%40fricas.org.

Reply via email to