| 1 | initial version |
slelievre's answer is general, and should be kept in mind ; in this specific case, SR has a specific suitable method :
sage: a.trig_reduce()
tan(x^2 + x + 1)
HTH,
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.