Opened 3 years ago
Last modified 7 months ago
#24587 new defect
Wrong integral of sqrt(1-cos(x))
Reported by: | tmonteil | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.2 |
Component: | symbolics | Keywords: | integrate |
Cc: | charpent, mafra, kcrisman | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Reported upstream. No feedback yet. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
As reported on this ask question:
sage: integral(sqrt(1-cos(x)), x, 0, 2*pi) 0
This comes from the following wrong primitive
sage: integral(sqrt(1-cos(x)), x, algorithm='maxima') -2*sqrt(2)/sqrt(sin(x)^2/(cos(x) + 1)^2 + 1)
where Fricas find a correct answer:
-2*(cos(x) + 1)*sqrt(-cos(x) + 1)/sin(x)
See Maxima bug 3659.
Change History (9)
comment:1 Changed 3 years ago by
- Cc mafra added
comment:2 Changed 3 years ago by
comment:3 Changed 10 months ago by
- Description modified (diff)
comment:4 Changed 10 months ago by
- Description modified (diff)
comment:5 Changed 10 months ago by
- Keywords integrate added
comment:6 Changed 7 months ago by
- Cc kcrisman added
This should be upstreamed to maxima. Karl-Dieter, would you do so, please ?
comment:7 Changed 7 months ago by
Interestingly, this may not necessarily be a problem with domain:complex
. Can you just confirm that the Fricas antiderivative makes more sense at this graphic? It's been a while since I've had to deal with branch cuts and I feel like that is part of the question here - but the way in which the graphs are different between pi and 2pi is definitely a problem. BUT Maxima gives the correct answer to the definite integral between pi and 2pi with either setting of domain
.
comment:8 Changed 7 months ago by
Okay, it is domain:complex
, but more subtly.
(%i1) integrate(sqrt(1-cos(x)), x, %pi, 2*%pi); 3/2 (%o1) 2 (%i2) integrate(sqrt(1-cos(x)), x, 0, 2*%pi); 5/2 (%o2) 2 (%i3) domain:complex; (%o3) complex (%i4) integrate(sqrt(1-cos(x)), x, %pi, 2*%pi); 3/2 (%o4) 2 (%i5) integrate(sqrt(1-cos(x)), x, 0, 2*%pi); (%o5) 0
This I am more confident about reporting upstream.
comment:9 Changed 7 months ago by
- Description modified (diff)
- Report Upstream changed from N/A to Reported upstream. No feedback yet.
#25220 fixes the problem with FriCAS.