tellsimp and trigonometry



On 7/3/2013 2:13 PM, Doug York wrote:
> ....

>
> Now
> (%i7) tellsimpafter(cos(aa)-sqrt(3)*sin(aa),-2*cos(aa-'gam))$
>        tellsimpafter(sqrt(3)*sin(aa)-cos(aa), 2*cos(aa-'gam))$
>
>
Both rules are really bad ideas.  You are advising "+"  that if it sees
EXACTLY 2 arguments, and they are EXACTLY what you specify,
that the rhs should be returned.  So something like cos(x)-sqrt(3)*sin(x)+1
WILL NOT MATCH.


It is much better to use tellsimp( ...)  only on functions of your own,  
f,g,etc  or
non-commutative functions of a fixed number of arguments.  e.g. sin().

Not  ..+...+.....


You could, if you wish, replace sin(aa)  by( 
2*cos(aa-'gam)-cos(aa))/sqrt(3).

or perhaps use ratsubst  to find, for each argument of cos,  say p, all
occurrence that can be divided out,  of sqrt(3)*sin(p)-cos(p).

RJF