Skip to content

Commit f6a36dd

Browse files
author
Release Manager
committed
sagemathgh-39362: Add doctest that integral of 0 function is 0 Fixes sagemath#33034. Issue sagemath#33034 pointed out that integrating a function that is identically zero can produce a nonzero value. However, this was a maxima bug that was fixed in sage 10.1. So we just add a doctest. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39362 Reported by: DaveWitteMorris Reviewer(s):
2 parents 80c65c2 + e1e4071 commit f6a36dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sage/misc/functional.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,13 @@ def integral(x, *args, **kwds):
777777
...
778778
sage: result # needs sage.symbolic
779779
-1/4
780+
781+
Verify that :issue:`33034` is fixed::
782+
783+
sage: f(x) = (x + sin(3*x)) * exp(-3*x*I)
784+
sage: h(x) = f(x) - f(x).expand()
785+
sage: integral(h(x), (x, 0, 2*pi))
786+
0
780787
"""
781788
if hasattr(x, 'integral'):
782789
return x.integral(*args, **kwds)

0 commit comments

Comments
 (0)