Ask Your Question

replacing even powers of sin(x) by powers of (1-cos(x)^2)

asked 2022-08-03 21:55:57 +0200

rhaynes74 gravatar image

Hi folks, I would like to force sage to take an expression like

f = cos(x)(sin(x))^2+cos(x)^3(sin(x))^5

and replace the even powers of sin(x) by powers of (1-cos(x)^2), so that the above would become


Any suggestions?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-08-03 23:17:30 +0200

Max Alekseyev gravatar image

One can use wildcards for this purpose:

f = cos(x)*(sin(x))^2+cos(x)^3*(sin(x))^5
w = SR.wild(0)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-08-03 21:55:57 +0200

Seen: 77 times

Last updated: Aug 03