Hi,
I am trying to convert a sum/difference of Cos[] into a product with the well know set of identities:
r0 = {Cos[U_] -> Cos[Expand[U]], Sin[U_] -> Sin[Expand[U]],
Cos[U_] + Cos[V_] -> 2*Cos[(U + V)/2]*Cos[(U - V)/2],
Cos[U_] - Cos[V_] -> -2*Sin[(U + V)/2]*Sin[(U - V)/2],
Sin[U_] + Sin[V_] -> 2*Sin[(U + V)/2]*Cos[(U - V)/2],
Sin[U_] - Sin[V_] -> -2*Sin[(U - V)/2]*Cos[(U + V)/2],
k_*(B + C) -> k*Pi - k*A, B + C -> Pi - A}
(* The expression to be converted is : *)
zz = 13 Cos[A] - 8 Cos[3 A] + Cos[5 A] - Cos[B - 5 C] + 5 Cos[B - 3 C] - 9 Cos[B - C] - 4 Cos[4 A] Cos[B - C]
- Cos[3 (B - C)] + 5 Cos[3 B - C] - Cos[5 B - C] + 8 Cos[3 B + C] - 2 Cos[5 B + C] + 8 Cos[B + 3 C] - 2 Cos[B + 5 C]
(* For a better conversion, some terms should be paired previously, for examples:
8 Cos[3 B + C] + 8 Cos[B + 3 C] ( Note the form k_*Cos[p_*B + q_*C] + k_*Cos[q_*B + p_*C] )
and
- Cos[B - 5 C] - Cos[5 B - C] ( Note the form k_*Cos[p_*B - q_*C] + k_*Cos[q_*B - p_*C] )
so, I created the following set of rules: *)
r1 = {Cos[U_] -> Cos[Expand[U]], Sin[U_] -> Sin[Expand[U]],
k_*Cos[p_*B + q_*C] + k_*Cos[q_*B + p_*C] -> 2*k*Cos[(p + q)/2*(B + C)]*Cos[(p - q)/2*(B - C)],
k_*Cos[p_*B + q_*C] - k_*Cos[q_*B + p_*C] -> -2*k*Sin[(p + q)/2*(B + C)]*Sin[(p - q)/2*(B - C)],
k_*Sin[p_*B + q_*C] + k_*Sin[q_*B + p_*C] -> 2*k*Sin[(p + q)/2*(B + C)]*Cos[(p - q)/2*(B - C)],
k_*Sin[p_*B + q_*C] - k_*Sin[q_*B + p_*C] -> -2*k*Sin[(p + q)/2*(B + C)]*Cos[(p - q)/2*(B - C)],
k_*(B + C) -> k*Pi - k*A, B + C -> Pi - A}
r2 = {Cos[U_] -> Cos[Expand[U]], Sin[U_] -> Sin[Expand[U]],
k_*Cos[p_*B - q_*C] + k_*Cos[q_*B - p_*C] -> 2*k*Cos[(p + q)/2*(B - C)]*Cos[(p - q)/2*(B + C)],
k_*Cos[p_*B - q_*C] - k_*Cos[q_*B - p_*C] -> -2*k*Sin[(p + q)/2*(B - C)]*Sin[(p - q)/2*(B + C)],
k_*Sin[p_*B - q_*C] + k_*Sin[q_*B - p_*C] -> 2*k*Sin[(p + q)/2*(B - C)]*Cos[(p - q)/2*(B + C)],
k_*Sin[p_*B - q_*C] - k_*Sin[q_*B - p_*C] -> -2*k*Sin[(p + q)/2*(B - C)]*Cos[(p - q)/2*(B + C)],
k_*B + k_*C -> k*Pi - k*A, k_*(B + C) -> k*Pi - k*A, B + C -> Pi - A}
The problem is that none of the following commands does the desirable work;
z1=zz //. r1;
z1=Simplify[zz //. r1,Trig];
z2=z1 //. r2;
z2=Simplify[z1 //. r2,Trig];
I also has changed Trig to False without success.
Does any one have a suggestion in order to make these conversions ?
Thanks in advance
César Lozada