I am trying to use Sympy to simplify some trigonometry. I realize that Sympy has a mature set of tools for dealing with this, so it seems like I must be missing something. However, I have spent a lot of time searching and can't seem to find exactly what I am looking for.
Question: How do you expand a simple trig function into its complex components?
MWE:
x = Symbol('x',real=True)
# The following works. Note that it expands cmplx functions into trig fncs
exp(I*x).expand(complex=True)
# Now try to go the other way
expand(sin(x)) #nope
expand_trig(sin(x)) #nope
expand(sin(x),complex=True) #nope
expand_complex(sin(x)) #nope
I also tried replace
, rewrite
, and xreplace
, but didn't get anywhere.