difference between EXPR INT and EXPR Complex INT

26 views
Skip to first unread message

Martin R

unread,
Nov 2, 2019, 2:55:20 PM11/2/19
to FriCAS - computer algebra system
Dear all,

maintaining the sage-FriCAS interface, I recently ran into the problem of converting expressions that contain the complex unit into FriCAS expressions.

I vaguely recall that EXPR INT contains the complex numbers, by using sqrt(-1), but I am not sure anymore.  Hence:

1) What is the difference between EXPR INT and EXPR Complex INT mathematically speaking?
2) Is it "correct" to use sqrt(-1) for the complex unit?

Thanks,

Martin

oldk1331

unread,
Nov 4, 2019, 12:41:41 AM11/4/19
to fricas...@googlegroups.com
Hi Martin, an old email from Waldek on this subject:

-------- Forwarded Message --------
Subject: Re: [fricas-devel] interesting error in integration
Date: Tue, 24 Jul 2018 00:12:30 +0200 (CEST)
From: Waldek Hebisch <heb...@math.uni.wroc.pl>
Reply-To: fricas...@googlegroups.com
To: fricas...@googlegroups.com

Martin R wrote:
>
> Nasser found the following interesting bug at
> https://trac.sagemath.org/ticket/25905:
>
> (1) -> f := (I*a*tan(d*x + c) + a)^3*tan(d*x + c)
>
> (1)
> 3 3 4 2 3 3 3 2
> I a tan(d x + c) + 3 I a tan(d x + c) + 3 I a tan(d x + c)
> +
> 3
> a tan(d x + c)
> Type:
> Expression(Integer)
> (2) -> F := integrate(f, x)
>
> (2)
> 2 3 1 3 3 3
> (9 I - 3)a log(-----------------) + 2 I a tan(d x + c)
> 2
> tan(d x + c) + 1
> +
> 2 3 2 3 3 3
3
> 9 I a tan(d x + c) + (- 6 I + 18 I)a tan(d x + c) + (6 I -
18 I)a
> d x
> /
> 6 d
> Type:
> Union(Expression(Integer),...)
> (3) -> D(eval(F, I =%i), x)-eval(f, I=%i)
>
> (3) 0
> Type:
> Expression(Complex(Integer))
> (4) -> F := integrate(eval(f, I=%i), x)
>
> >> System error:
> arithmetic error DIVISION-BY-ZERO signalled
> Operation was (/ -2 0).
>
> Any ideas?

This is old confusion between real and complex. We create
Complex(Complex(Integer)) and loose. It would be good to
clean this up. AFAICS proper fix should not require much
code, but it is going to touch several domains and packages.
Basically, old code assumed that functions are real and
allowed complex functions only as a hack. Current
'FunctionSpaceComplexIntegration' integrates _real_
function by passage to complex variables. We need a
function to integrate _complex_ functions.

--
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 fricas-devel...@googlegroups.com
> <mailto:fricas-devel...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/41025454-9c01-4490-9002-56d424960ea9%40googlegroups.com
> <https://groups.google.com/d/msgid/fricas-devel/41025454-9c01-4490-9002-56d424960ea9%40googlegroups.com?utm_medium=email&utm_source=footer>.

Martin R

unread,
Nov 4, 2019, 3:23:33 AM11/4/19
to FriCAS - computer algebra system
Thank you!  Unfortunately, I am still not clear on the difference.  Is the following correct:

EXPR INT assumes real variables and functions, and EXPR Complex INT is a hack?

Martin

Martin R

unread,
Nov 13, 2019, 2:37:42 AM11/13/19
to FriCAS - computer algebra system
ping?

Waldek Hebisch

unread,
Nov 13, 2019, 11:41:00 AM11/13/19
to fricas...@googlegroups.com
Unfortunately, short answers are incorrect. Expression was discussed
several times in this list and from back post you should be able to
assemble reasonable answer. Sorry, I have no time to search for
you or to write answers again.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages