| 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)))})
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.