working on part of an expression

asked 2015-03-31 17:12:14 +0200

beeson gravatar image

updated 2024-07-09 08:27:25 +0200

FrédéricC gravatar image

I came across a complicated expression containing cos(4t). I wanted to change it to 1-sin(2t)^2. The tools are trig_reduce, trig_expand, and trig_simplify. One of them expresses everything in trig functions of t and the other two are useless. And all three will work on the entire expression, not just on one part. So this is a very general question: how can I get sage to do something to just one part of an expression, rather than the whole expression? (I suppose I could extract the part, work on it, and then substitute the result back in, but that would be difficult!)

And even on a standalone basis, I don't know how to change cos(4t) to 1-sin(2t)^2.

edit retag flag offensive close merge delete