Why does it not simplify to zero? Cosine seems to work. Why?
from sympy import *
x = Symbol("x")
expr = (1/(2*I)) * (E**(I*x) - E**(-I*x))
print(simplify(expr - sin(x)))
Sympy's simplification routines are necessarily heuristic, so you'll have to give them some hints. In this case, you can tell sympy to rewrite everything in terms of exponentials:
simplify((expr - sin(x)).rewrite(exp)) # 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With