Basic trigonometric simplifications in Symbolics.jl

Julia: v1.9.0
Symbolics.jl: v5.3.1

Not sure if this is the intended behavior:

using Symbolics

@variables x

simplify(sin(x) + sin(-x))


sin(x) + sin(-x)

instead of 0, which is really surprising. Then checked if I could write down a rewriting rule using SymbolicUtils.jl like this:

using SymbolicUtils

@syms a
r = @rule sin(-(~a)) => -sin(~a)

which prints nothing! Am I doing something wrong here?

1 Like