pythonmathjuliacomplex-numberswolframalpha

expanding complex-valued functions in Julia


In Wolfram Alpha I can use complex expand sin(x + Iy) to get back sin(x) cosh(y) + i cos(x) sinh(y). Is there a package in Julia or alternatively Python that does the same?


Solution

  • In Julia, I find this

    using SymPy
    @syms x,y
    sympy.expand_trig( sin(x + im*y) )
    
    #sin(x)⋅cosh(y) + ⅈ⋅cos(x)⋅sinh(y)
    

    The similar solution can also be found in the library SymPy of Python.