I'm new to SymPy and this group. My apologies if I'm submitting this to
the wrong group. Please feel free to indicate a more appropriate alternate
group, if there is such.
I ran into a behavior of the *simplify* function which strikes me as
strange. Notice that *in[4]* and *in[5]* below are identical, except that
the expression to be simplified in the latter is the negative of the
former. *out[4]* is what I expected, but *out[5]* is not. Shouldn't
*out[5]* be the negative of *out[4]*? Can anyone explain? Note that
*out[5]* is not mathematically incorrect but just not what one would expect.
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 15:01:46)
[MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 4.0.3 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from sympy import *
In [2]: init_session()
IPython console for SymPy 1.0 (Python 3.5.1-64-bit) (ground types: python)
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()
Documentation can be found at http://docs.sympy.org/1.0/
In [3]: theta = symbols('theta', real=True)
In [4]: simplify(+I/2*exp(I*theta) - I/2*exp(-I*theta))
Out[4]: -sin(theta)
In [5]: simplify(-I/2*exp(I*theta) + I/2*exp(-I*theta))
Out[5]:
/ 2*I*theta \ -I*theta
I*\- e + 1/*e
------------------------------
2

--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/8f8a18c6-0699-441d-9e62-36688157540f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.