First reported as in Sage's ticket 24231, found in 5.39.0 (as packaged in Sage) and 5.40.0 (as packaged in Debian) :
(%i5) map(lambda([t],[t,demoivre(exponentialize(t(x)))]),[sin,cos,tan,sinh,cosh,tanh]);
(%o5) [[sin,sin(x)],[cos,cos(x)],[tan,sin(x)/cos(x)],[sinh,(%e^x-%e^-x)/2],
[cosh,(%e^x+%e^-x)/2],[tanh,(%e^x-%e^-x)/(%e^x+%e^-x)]]
demoivre does what it"s supposed to do with trigonometric expressions in exponential form, but not with hyperbolic ones.
demoivre is behaving as documented.
Macsyma 2.4 has a package algfuncs, which has miscellaneous algebraic functions.
demoivreh(exp,var) is one of them. See the following:
Last edit: Richard Gobeli 2018-01-14