Opened 8 years ago
Closed 7 years ago
#11591 closed defect (fixed)
Incorrect results for integrals involving exponential functions
Reported by: | mjo | Owned by: | burcin |
---|---|---|---|
Priority: | major | Milestone: | sage-5.0 |
Component: | calculus | Keywords: | |
Cc: | mjo | Merged in: | sage-5.0.beta3 |
Authors: | Michael Orlitzky | Reviewers: | Aly Deines |
Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #12094 | Stopgaps: |
Description
Posted to sage-support by Robin Hankin,
http://groups.google.com/group/sage-support/browse_thread/thread/1209ff5cb106d99c
Actual result:
sage: f = (x^2)*exp(x) / (1+exp(x))^2 sage: integrate(f, (x, -infinity, infinity)) 0
Expected result:
sage: from mpmath import * sage: mp.pretty=True sage: quad(lambda x:(x^2)*exp(x)/(1+exp(x))^2,[-inf,+inf]) 3.28986813369645
Attachments (1)
Change History (13)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
- Milestone set to sage-4.7.1
comment:3 Changed 8 years ago by
- Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.
comment:4 Changed 8 years ago by
Here's how to replicate this directly in Maxima:
deep:sage wstein$ sage -maxima ;;; Loading #P"/Users/wstein/sage/install/current/local/lib/ecl/sb-bsd-sockets.fas" ;;; Loading #P"/Users/wstein/sage/install/current/local/lib/ecl/sockets.fas" ;;; Loading #P"/Users/wstein/sage/install/current/local/lib/ecl/defsystem.fas" ;;; Loading #P"/Users/wstein/sage/install/current/local/lib/ecl/cmp.fas" Maxima 5.23.2 http://maxima.sourceforge.net using Lisp ECL 11.1.1 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) integrate(x^2*%e^x/(%e^x+1)^2,x,minf,inf); (%o1) 0
comment:5 Changed 8 years ago by
I just realized that I left in an extra denominator in the expected output. However, zero is still obviously incorrect.
comment:6 Changed 8 years ago by
- Report Upstream changed from Not yet reported upstream; Will do shortly. to Fixed upstream, in a later stable release.
This is fixed in the newest Maxima (5.24.0):
Old:
(%i1) f:(x^2)*%e^x / (1+%e^x)^2; 2 x x %e (%o1) ---------- x 2 (%e + 1) (%i2) integrate(f,x,minf,inf); (%o2) 0
New:
(%i6) integrate(f,x,minf,inf); 2 %pi (%o6) ---- 3 (%i7)
comment:7 Changed 7 years ago by
- Dependencies set to #12094
comment:8 follow-up: ↓ 9 Changed 7 years ago by
Michael, do you want to make a patch for this as well? It would be nice to have an easy queue to apply for all of these update patches. Good work on all of this.
comment:9 in reply to: ↑ 8 Changed 7 years ago by
Replying to kcrisman:
Michael, do you want to make a patch for this as well? It would be nice to have an easy queue to apply for all of these update patches. Good work on all of this.
Thanks, yes, I should be able to create separate patches for everything in the morning.
comment:10 Changed 7 years ago by
- Cc mjo added
- Status changed from new to needs_review
comment:11 Changed 7 years ago by
- Reviewers set to Aly Deines
- Status changed from needs_review to positive_review
comment:12 Changed 7 years ago by
- Merged in set to sage-5.0.beta3
- Resolution set to fixed
- Status changed from positive_review to closed
A related Maxima issue I found after a few seconds of looking into this: