Trigonometric identities
I have an expression which has both sines and cosines and would like to write it using only sines (or cosines), possibly using the power-reduction formula . I tried to use SymPy but I cannot make it to "rewrite" to the desired output: angle = symbols('angle') print (sin(angle)**2).rewrite(sin, cos) # (1 - cos(2*angle))/2 print ((1 - cos(2*angle))/2).rewrite(cos, sin) # sin(angle)**2 Is there any way to tell Sympy to rewrite such expression using only sines (or cosines)? unutbu The sympy.simplify.fu module defines a number of transformations based on trig identities: TR0 - simplify expression