MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Trignometric rules

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118170] Re: Trignometric rules
  • From: Peter Pein <petsie at dordos.net>
  • Date: Fri, 15 Apr 2011 03:56:10 -0400 (EDT)
  • References: <io6d3h$drj$1@smc.vnet.net>

Am 14.04.2011 11:00, schrieb Chelly:
> 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
>

Hi Chelly,

use pattern matching:

tt /. Cos[pb:(s_. \[Phi]b /; Abs[s] == 1) + x_.] :> 2 Sin[pb] Sin[x]

Peter


  • Prev by Date: Re: Coloring curves: not as simple as it sounds..
  • Next by Date: Re: broadcasting of Equal ? (newbie question)
  • Previous by thread: Re: Trignometric rules
  • Next by thread: Re: Trignometric rules