Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 3db6f89

Browse files
committed
17065: do trigrat after trigexpand; doctest
1 parent 6996fd8 commit 3db6f89

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/sage/symbolic/expression.pyx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8277,13 +8277,20 @@ cdef class Expression(CommutativeRingElement):
82778277
sage: f.simplify_trig(False)
82788278
sin(3*x)/cos(3*x)
82798279
8280+
Simplification includes linearization of rational arguments
8281+
(Maxima's ``trigrat()``), see :trac:`17065`::
8282+
8283+
sage: ex=sin(1/8*pi)*sin(3/8*pi)*sin(5/8*pi)*sin(7/8*pi)
8284+
sage: ex.simplify_trig()
8285+
1/8
8286+
82808287
"""
82818288
# much better to expand first, since it often doesn't work
82828289
# right otherwise!
82838290
if expand:
8284-
return self.parent()(self._maxima_().trigexpand().trigsimp())
8291+
return self.parent()(self._maxima_().trigexpand().trigrat().trigsimp())
82858292
else:
8286-
return self.parent()(self._maxima_().trigsimp())
8293+
return self.parent()(self._maxima_().trigrat().trigsimp())
82878294

82888295
trig_simplify = simplify_trig
82898296

0 commit comments

Comments
 (0)