Comment #13 on issue 2098 by nicolas....@gmail.com: solve(x**2+1,x) does not check if x is real.
http://code.google.com/p/sympy/issues/detail?id=2098

The problem is, solve() API is IMO currently ugly, so it's really painful to deal with all possible output formats. At least, there's now some up-to-date doc thanks to Chris work (https://github.com/sympy/sympy/pull/423). But I don't know how to deals cleanly with things like that (quoting solve() docstring):

"""
                if there is no linear solution then the first successful
                attempt for a nonlinear solution will be returned
                    >>> solve(x**2 - y**2, x, y)
                    [y, -y]
                    >>> solve(x**2 - y**2/exp(x), x, y)
                    [x*exp(x/2), -x*exp(x/2)]
"""

I can't determine with the output which symbol was actually used for solving. Well, in fact, I can here, because x is in the output but not y.
However, this is not always True.

solve(z**2*x**2 - z**2*y**2/exp(x), x, y,z)
[x*exp(x/2), -x*exp(x/2)]        # is it y or z ?

I'm not sure it makes sense to spend much time with this, since we have to agree on an output format anyway (issue 2464 for example...).

However, I already have a fix for the most simple case: one equation and one variable.

Is it OK to fix only this case first (since this is also the most common case), waiting for a decision for solve() output format before dealing with the other cases ?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to