Hi,
I want to realize the addition theorem for the arctangent using
defrule:
matchdeclare([aa,bb,cc],true);
defrule(atanplus,atan(aa)+atan(bb)+cc,atan(xthru((aa+bb)/(1-aa*bb)))+cc);
(a couple of arctangents in a sum of terms which need not all be
arctangents)
That works well for the addition of arctangents,
but not for subtracion.
A respective rule for subtraction does not work and yields the message
"defmatch: -atan(bb)*1
will be matched uniquely since sub-parts would otherwise be
ambigious."
Leaving out the additional term "cc" does not give the desired result:
(%i32)
defrule(atanminus,atan(aa)-atan(bb),atan(xthru((aa-bb)/(1+aa*bb))))$
(%i33) apply1(atan(a)-atan(c)+atan(b),atanplus,atanminus);
(%o33) atan((-(1-a*b)*c+b+a)/((b+a)*c-a*b+1)) ... o.k.
(%i34) apply1(atan(a)-atan(c)+atan(b)+1,atanplus,atanminus);
(%o36) -atan(c)+atan((b+a)/(1-a*b))+1 ... not o.k.!
Is there any clean possibility to incorporate also subtractions
of arctangents into the addition theorem?
Thanks in advance
Wilhelm