integrate() doesn't respect "real_part"

44 views
Skip to first unread message

John Schneeloch

unread,
Apr 8, 2022, 11:23:51 AM4/8/22
to sage-devel
Here's my code:

var('phi, A')
assume(phi, 'real', A, 'complex')
y = real_part
y

The output is (cos(phi)*real_part(A) - imag_part(A)*sin(phi))^2

But if I integrate:
integrate(y, (phi,0,2*pi))

I get this error message
Help file /Applications/usr/share/giac/doc/fr/aide_cas not found Added 0 synonyms

and the result
pi*A^2

which ignores the "real_part" command. I get the correct result if I choose "sympy" as the algorithm in integrate, but it seems like the default behavior is buggy.

I am running SageMath, version 9.5, Release Date: 2022-01-30. I'm running it in a Jupyter notebook, server version 6.4.6. The python version is
Python 3.9.9 (main, Jan 31 2022, 12:12:21)
[Clang 13.0.0 (clang-1300.0.29.3)]
I am using Mac OS 10.14.6. I believe I'm using a 64-bit macbook.

John

dmo...@deductivepress.ca

unread,
Apr 9, 2022, 1:54:28 PM4/9/22
to sage-devel
Thanks for the bug report.  I opened trac tickets #33664 and #33665, because there actually seem to be two problems: the interface to maxima, and the interface to giac.
Reply all
Reply to author
Forward
0 new messages