Opened 13 months ago
Last modified 3 weeks ago
#31687 new defect
factor() does not work in a simple case
Reported by: | gh-GMS103 | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.7 |
Component: | factorization | Keywords: | |
Cc: | slelievre | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
In Sage 9.2 on SageCell and CoCalc (same on Sage 9.3.rc2):
sage: version() 'SageMath version 9.2, Release Date: 2020-10-24' sage: x, y = var('x, y') sage: f = (x - 5)*y/x - (x - 6)*y/x ; f (x - 5)*y/x - (x - 6)*y/x sage: f.factor() # does not work (x - 5)*y/x - (x - 6)*y/x sage: (f*x).factor() # does not work either x*((x - 5)*y/x - (x - 6)*y/x) sage: (f*x).expand()/x # expected result y/x
Of course, this is a very simple example showing the problem.
Change History (5)
comment:1 Changed 13 months ago by
- Cc slelievre added
- Description modified (diff)
comment:2 Changed 13 months ago by
Well, actually in this case it suffices to expand:
sage: f.expand() y/x
But I was wondering about the cause of this behaviour (I do not think I would be able to find it myself).
comment:3 Changed 9 months ago by
- Milestone changed from sage-9.4 to sage-9.5
comment:4 Changed 5 months ago by
- Milestone changed from sage-9.5 to sage-9.6
comment:5 Changed 3 weeks ago by
- Milestone changed from sage-9.6 to sage-9.7
Note: See
TracTickets for help on using
tickets.
A workaround is to factor the numerator and denominator:
Or, in this case, to work in the fraction field of a polynomial ring.