trigsimp , as Aristocrat points out, does the opposite, because sin(x) + sin(y) simpler than 2*sin((x + y)/2)*cos((x - y)/2) .
trigsimp internally uses an algorithm based on Fu, et. al. which matches the pattern according to various trigonometric identities. If you look at the source code , all identifiers are written in separate functions (functions are named after sections in the Fu document).
Look at the list of simplifications at the top of the file that you probably need.
TR9 - contract sums of sin-cos to products
Checking this, it looks like it works
In [1]: from sympy.simplify.fu import TR9 In [2]: TR9(sin(x) + sin(y)) Out[2]: βxyβ βxyβ 2β
sinββ + βββ
cosββ - ββ β2 2β β2 2β
Ultimately, we would like to include them in more user-friendly functions, but at the moment the fu.py file fu.py well-documented, even if all the function names are not particularly memorized.
source share