-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Description
I just stumbled upon this very surprising issue.
$ isympy
IPython console for SymPy 1.14.0 (Python 3.12.3-64-bit) (ground types: python)
These commands were executed:
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()
Documentation can be found at https://docs.sympy.org/1.14.0/
In [1]: integrate(abs(sin(2*x)), (x, 0, 2*pi))
Out[1]: 2
while I am fairly convinced, by my calculations on paper and a quick check with WolframAlpha, that the result should be 4.
Edit: In fact, the result of integrate(abs(sin(k*x)), (x, 0, 2*pi)) is 4 for all k, but sympy is returning 4 / k instead.