Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Well...

sage: cos(3*x).trig_expand()
cos(x)^3 - 3*cos(x)*sin(x)^2

Sage has a lot of tutorials ; a (somewhat helicopteric) tour of Sage, a main tutorial, and many more indexed here. There is also an excellent (while slightly outdated) book introducing a lot of Sage concepts in various branches of mathematical computing (warmingly recommended).

In other words, RTFM...

HTH,

Well...

sage: cos(3*x).trig_expand()
cos(x)^3 - 3*cos(x)*sin(x)^2

Sage has a lot of tutorials ; a (somewhat helicopteric) tour of Sage, a main tutorial, and many more indexed here. There is also an excellent (while slightly outdated) book introducing a lot of Sage concepts in various branches of mathematical computing (warmingly recommended).

The reference manual is also easily accessible "inline" : typing

sage: x.trig_expand?

displays about 4 screenfuls of description and examples, starting with :

Docstring:     
   Expand trigonometric and hyperbolic functions of sums of angles and
   of multiple angles occurring in "self".

   For best results, "self" should already be expanded.

   INPUT:

   * "full" -- boolean (default: "False"); to enhance user control of
     simplification, this function expands only one level at a time by
     default, expanding sums of angles or multiple angles. To obtain
     full expansion into sines and cosines immediately, set the
     optional parameter full to "True".

   * "half_angles" -- boolean (default: "False"); if "True", causes
     half-angles to be simplified away

   * "plus" -- boolean (default: "True"); controls the sum rule.
     Expansion of sums (e.g. \sin(x + y)) will take place only if
     "plus" is "True".

   * "times" -- boolean (default: "True"); controls the product rule,
     expansion of products (e.g. \sin(2 x)) will take place only if

[ elided... ]

In other words, RTFM...

HTH,