how do I expand cos(n*theta)
how do I expand cos(n*theta) into a polynomial in sin(theta) and cos(theta) for a range of integers n
You could use the simplify_trig method:
sage: var('theta')
theta
sage: cos(2*theta).simplify_trig()
2*cos(x)^2 - 1
sage: [cos(n*theta).simplify_trig() for n in range(1, 10)]
...
Asked: 2023-09-13 18:29:34 +0100
Seen: 164 times
Last updated: Sep 13 '23
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.