-
-
Notifications
You must be signed in to change notification settings - Fork 723
Open
Description
Symbolic methods on relational expressions (equalities and inequalities) work inconsistently. Some of them directly apply to both sides, some don't do anything at all, and some behave unexpectedly.
For example, collect does nothing (same with inequalities):
sage: var('y')
y
sage: eq = x^2 + x*y + 3*x == 0
sage: eq.collect(x)
x^2 + x*y + 3*x == 0
sage: eq.lhs().collect(x)
x^2 + x*(y + 3)
limit behaves differently with different arguments, and it's not at all clear what it's doing:
sage: eq = exp(-x) == x
sage: eq.limit(x=0)
0
sage: eq.limit(x=2)
e^(-2) == 2
factor takes equalities and returns a non-relational expression:
sage: (x^2 + x == 0).factor()
(x + 1)*x
and doesn't work at all with inequalities:
sage: (x^2 + x > 0).factor()
ValueError: Unable to represent as a polynomial
Even more strange:
sage: (x == 3).exp()
e^(x == 3)
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/21862