Ask Your Question

Revision history [back]

Here is a procedure that yields to trig functions of 2*t only:

sage: s = sin(4*t) + sin(2*t)
sage: var('u')
u
sage: s.subs(t=u/2)
sin(2*u) + sin(u)
sage: s.subs(t=u/2).expand_trig()
2*cos(u)*sin(u) + sin(u)
sage: s.subs(t=u/2).expand_trig().subs(u=2*t)
2*cos(2*t)*sin(2*t) + sin(2*t)
sage: s.subs(t=u/2).expand_trig().subs(u=2*t).factor()
(2*cos(2*t) + 1)*sin(2*t)