mathics-core icon indicating copy to clipboard operation
mathics-core copied to clipboard

x == x seems to have no solutions in Reals

Open p4vook opened this issue 3 years ago • 2 comments

Description

The "Domain" argument in Solve seems to mess something up

In[1]:= Solve[x == x, x]
Out[1]= {{}}

In[2]:= Solve[x == x, x, Reals]
Out[2]= {}

p4vook avatar Aug 25 '22 17:08 p4vook

It appears to be a general problem of sympy.solve. sympy recommends to use solveset instead, where it's possible.

Another example: Solve[Sin[x] == 0, x] returns only two results: $0$ and $\pi$.

p4vook avatar Aug 25 '22 17:08 p4vook

Looking at the SymPy documentation on Solveset and Solvers, I see this gets very complicated very quickly for Mathics or any system to try to figure out automatically.

However WMA Solve does provide for Options, and we could easily add one called "Solvset" which uses the solveset SymPy function instead of solve.

@pavel-the-best would you like to try to implement this?

rocky avatar Aug 25 '22 18:08 rocky