Opened 14 years ago
Closed 7 years ago
#3520 closed defect (duplicate)
inconsistency in simplify_radical
Reported by: | wdj | Owned by: | gfurnish |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | symbolics | Keywords: | |
Cc: | burcin, AlexGhitza, mjo | Merged in: | |
Authors: | Reviewers: | Michael Orlitzky, Karl-Dieter Crisman | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This is a problem:
sage: f = sqrt(25-x)*sqrt(1+1/(4*(25-x))) sage: f.integral(x,9,16) integrate(sqrt(1/(4*(25 - x)) + 1)*sqrt(25 - x), x, 9, 16) sage: f.nintegral(x,9,16) (24.9153783348643, 2.7661626694613149e-13, 21, 0) sage: g = f.simplify_radical() sage: g.integral(x,9,16) I*(65*sqrt(65)*I/6 - 37*sqrt(37)*I/6)/2 sage: ans = g.integral(x,9,16) sage: ans.real() (37*sqrt(37)/6 - 65*sqrt(65)/6)/2 sage: RR(ans.real()) -24.9153783348643
Change History (19)
comment:1 Changed 14 years ago by
comment:2 Changed 13 years ago by
With the new symbolics and Maxima 5.19.1:
sage: sqrt(25-x)*sqrt(1+1/(4*(25-x))) sqrt(-1/4/(x - 25) + 1)*sqrt(-x + 25) sage: f = _ sage: f.integral(x) 1/12*(4*I*x - 101*I)*sqrt(4*x - 101) sage: f.integral(x,9,16) -37/12*sqrt(37) + 65/12*sqrt(65) sage: f.nintegral(x,9,16) (24.9153783348643, 2.7661626694613149e-13, 21, 0) sage: g = f.simplify_radical() sage: g.integral(x,9,16) 37/12*sqrt(37) - 65/12*sqrt(65) sage: ans = g.integral(x,9,16) sage: ans.real() 37/12*sqrt(37) - 65/12*sqrt(65) sage: RR(ans.real()) -24.9153783348643
Maxima can now integrate the original one, but still gives the wrong simplification (?) of f. It seems to be choosing the wrong square root of negative one, as it were, since
sage: j = -g sage: j.integrate(x,9,16) -37/12*sqrt(37) + 65/12*sqrt(65)
So the real problem is in simplify_radical().
comment:3 Changed 13 years ago by
- Cc burcin added
comment:4 Changed 13 years ago by
- Cc AlexGhitza added
One may want to check the latest CVS of Maxima, where I believe some definitions relating to this have changed.
comment:5 Changed 12 years ago by
- Component changed from calculus to symbolics
- Report Upstream set to N/A
- Summary changed from bug in integrating sqrt to inconsistency in simplify_radical
Just updating. This is still in 5.20.1, but it's not clear whether this is really a bug, since radical simplifications will in their nature sometimes change which square root of -1 they use, and perhaps it's not possible to do so consistently across multiplication or division. Comments?
comment:6 Changed 12 years ago by
Maxima devs have been discussing some things related to this, so it could be worth checking whether this has changed again in their CVS.
comment:7 Changed 11 years ago by
What is really going on here is that simplify_radical
uses radcan
under the hood, which treats things as symbolic expressions, not functions, and just chooses a branch - consistently, but arbitrarily. At least I think that is what is here. See the Maxima list thread starting here.
comment:8 Changed 9 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:9 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:10 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:11 Changed 8 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:12 follow-up: ↓ 13 Changed 8 years ago by
- Cc mjo added
comment:13 in reply to: ↑ 12 ; follow-up: ↓ 14 Changed 8 years ago by
comment:14 in reply to: ↑ 13 ; follow-up: ↓ 15 Changed 8 years ago by
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
It seems to be that this is probably a dup of #14305, #11912, and/or other such tickets. Thoughts?
Indeed, #11912 "fixes" it by renaming
simplify_radical
and updating its documentation so that it's very clear that this might happen.
In which case perhaps this integration example could be added there.
comment:15 in reply to: ↑ 14 ; follow-up: ↓ 16 Changed 8 years ago by
Replying to kcrisman:
In which case perhaps this integration example could be added there.
There are a lot of examples of problems with simplify_radical
, but this one isn't particularly clear. It's not like someone is going to see the example in the description and go "oh, that affects me!"
I think this ultimately comes down to sqrt(x^2)
anyway, and that is included as an example.
That was my reasoning anyway. If it will help get it reviewed faster, I'll add whatever you want =)
comment:16 in reply to: ↑ 15 Changed 8 years ago by
In which case perhaps this integration example could be added there.
That was my reasoning anyway. If it will help get it reviewed faster, I'll add whatever you want =)
Well, I think that pointing out that things you might not think would be affected is not bad.
comment:17 follow-up: ↓ 18 Changed 8 years ago by
Ok, I've just added this example to the branch at #11912.
comment:18 in reply to: ↑ 17 Changed 8 years ago by
- Reviewers set to Michael Orlitzky, Karl-Dieter Crisman
- Status changed from needs_review to positive_review
Ok, I've just added this example to the branch at #11912.
Sweet.
comment:19 Changed 7 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Just for reference, the same with MMA6: