Subject: Maxima:Products and sums of trigonometric terms
From: Constantine Frangos
Date: Thu, 1 Nov 2007 22:53:03 +0200
I have an expression which can be either a product of trigonometric terms
or a sum of trigonometric terms, for example: expr = z1*z2 or expr = z1 + z2.
(1) Is there a Maxima command that indicates whether expr is a product of
terms or a sum of terms ?
(2) In applying the built-in Maxima simplification functions trigsimp,
trigreduce, trigrat, etc on products of terms, it seems that the map function
has to be used to obtain the desired simplification (example below).
Is there perhaps another approach ?
Thanks very much.
C. Frangos.
%i271) z1;
(%o271) cos(q2)*sin(q4)+sin(q2)*cos(q4)
(%i272) z2;
(%o272) sin(q6+q5)*cos(q8)
(%i273) trigsimp(z1*z2);
(%o273) (cos(q2)*sin(q4)+sin(q2)*cos(q4))*sin(q6+q5)*cos(q8)
(%i274) trigrat(z1*z2);
(%o274) -(cos(q8+q6+q5+q4+q2)-cos(q8+q6+q5-q4-q2)-cos(q8-q6-q5+q4+q2)
+cos(q8-q6-q5-q4-q2))
/4
(%i275) trigreduce(z1*z2);
(%o275) (cos(q8+q6+q5-q4-q2)-cos(q8+q6+q5+q4+q2))/4
+(cos(q8-q6-q5+q4+q2)-cos(q8-q6-q5-q4-q2))/4
(%i276) map(trigreduce,z1*z2);
(%o276) sin(q4+q2)*sin(q6+q5)*cos(q8)
(%i277) map(trigrat,z1*z2);
(%o277) sin(q4+q2)*sin(q6+q5)*cos(q8)
(%i278) map(trigsimp,z1*z2);
(%o278) (cos(q2)*sin(q4)+sin(q2)*cos(q4))*sin(q6+q5)*cos(q8)
(%i279)