Re: Trignometric rules
- To: mathgroup at smc.vnet.net
- Subject: [mg118239] Re: Trignometric rules
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 17 Apr 2011 07:55:07 -0400 (EDT)
The x_ and y_ are unnecessary in your examples so I have simplified by eliminating them. I have also eliminated the Greek letters to simplify reading the InputForm of the expressions. 2 k1^3 k2 v^2 e1^3 ec^2 Cos[d1+d3+pb+pr]/. {A_*Cos[a_+pb]->A*pb*Sin[a]} 2*e1^3*ec^2*k1^3*k2*pb*v^2*Sin[d1 + d3 + pr] 2 k1 k2 u^2 e1 Cos[d1+d2-pb-pr]/. A_*Cos[b_-pb]->-A*pb*Sin[b] 2*e1*k1*k2*u^2*Cos[d1 + d2 - pb - pr] For the second example, compare the FullForm representations (which is what ReplaceAll acts on) 2 k1 k2 u^2 e1 Cos[d1+d2-pb-pr]//FullForm Times[2,e1,k1,k2,Power[u,2],Cos[Plus[d1,d2,Times[-1,pb],Times[-1,pr]]]] LHS of second rule A_*Cos[b_-pb]//FullForm Times[Cos[Plus[pb,Times[-1,Pattern[b,Blank[]]]]],Pattern[A,Blank[]]] Note that -pb does not show up as such. The rule {A_*Cos[a_+c_.*pb] -> A*c*pb*Sin[a]} will work for both 2 k1^3 k2 v^2 e1^3 ec^2 Cos[d1+d3+pb+pr]/. {A_*Cos[a_+c_.*pb]->A*c*pb*Sin[a]} 2*e1^3*ec^2*k1^3*k2*pb*v^2*Sin[d1 + d3 + pr] 2 k1 k2 u^2 e1 Cos[d1+d2-pb-pr]/. A_*Cos[b_+c_.*pb]->-A*c*pb*Sin[b] 2*e1*k1*k2*pb*u^2*Sin[d1 + d2 - pr] Bob Hanlon ---- Alexei Boulbitch <alexei.boulbitch at iee.lu> wrote: ============= Indeed, why this works: 2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 Cos[ d1 + d3 + \[Phi]b + \[Phi]r] /. {A_*Cos[a_ + \[Phi]b + x_] -> A*\[Phi]b*Sin[a + x]} 2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 \[Phi]b Sin[ d1 + d3 + \[Phi]r] while this: 2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] /. A_*Cos[b_ - \[Phi]b + y_] -> -A*\[Phi]b*Sin[b + y] 2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] does not? Best, Alexei I have an expression as hsown below tt = -4 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[2 d1 + d2 + d3] - 2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] + 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ 2 d1 + d2 + d3 - \[Phi]b - \[Phi]r] + 2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 Cos[ d1 + d3 + \[Phi]b + \[Phi]r] + 2 k1^2 u^2 \[Epsilon]1^2 Cos[2 d1 + d2 + d3 + \[Phi]b + \[Phi]r] - 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ 2 d1 + d2 + d3 + \[Phi]b + \[Phi]r]; I'd like to replace any term containing Cos[+/- phib + x_] with 2 Sin [+/-phib] Sin[x]. How do I go about doing it. Thanks Chelly -- Alexei Boulbitch, Dr. habil. Senior Scientist Material Development IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 CONTERN Luxembourg Tel: +352 2454 2566 Fax: +352 2454 3566 Mobile: +49 (0) 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu www.iee.lu