Update - Some combination of TR7, TR8, and expand() seems to work for powers that I've tried. For example:
In [5]: TR8(expand(TR8(cos(x)**7))) > Out[5]: 35*cos(x)/64 + 21*cos(3*x)/64 + 7*cos(5*x)/64 + cos(7*x)/64 But it's not clear to me how I would do that in a programmatic way. Jeremy On Friday, March 27, 2015 at 4:51:53 PM UTC-4, Jeremy Holleman wrote: > > Thanks! That did exactly what I want for cos**2. I would also like to > reduce the power on higher order terms. I tried TR7() on cos(x)**3 and > cos(x)**4 and it did not make any changes. From quick glance here ( > https://github.com/sympy/sympy/blob/master/sympy/simplify/fu.py), TR7 > seems like the right function for power-reducing. Do you know of a method > to do the same thing with larger powers? > > A clean way to iteratively break off 2nd-order chunks, apply TR7, and > distribute would be a viable, but kludgy, alternative. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/fcdb6e96-dd59-4dda-9489-290e1881b7dc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.