Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One can use wildcards for this purpose:

f = cos(x)*(sin(x))^2+cos(x)^3*(sin(x))^5
w = SR.wild(0)
f.subs({sin(x)^w:((1-cos(x)^2)^floor(w/2)*sin(x)^(w-2*floor(w/2)))})