Re: Extensive replacement of trigonometric functions
- To: mathgroup at smc.vnet.net
- Subject: [mg125027] Re: Extensive replacement of trigonometric functions
- From: andres <jarosham at gmail.com>
- Date: Sat, 18 Feb 2012 06:26:41 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jhldmn$ouo$1@smc.vnet.net>
So, you don't want Mathematica to evaluate the expression -Cos[\ [Theta] + (2 \[Pi])/3]? Since -Cos[\[Theta] + (2 \[Pi])/3] = Sin[\[Theta] + \[Pi]/6], I assume you want to format the output for visualization purposes, because both expressions will give the same results. If this is the case, I would take two approaches: either apply a Hold to the rhs of the rule, or I'd use a rule of the type Sin[\[Theta]_ + \[Pi]/6] :> -cos[\[Theta] + (2 \[Pi])/3], so that the inexistent function "cos" keeps unevaluated. If then you want to evaluate the expression you can release the Hold or define cos[\[Theta]_] := Cos[\[Theta]]. Hope it helps. Andr=E9s On Feb 17, 6:29 am, Mauro <pi... at hotmail.com> wrote: > Hello to everybody. > > I have this problem: I would like to replace in a long expression all > the occurrences of: > > Sin[\[Theta]_ + \[Pi]/6] and Sin[\[Theta]_ - \[Pi]/6] > > with respectively: > > -Cos[\[Theta] + (2 \[Pi])/3] and Cos[\[Theta] - (2 \[Pi])/3] > > (which actually are the same thing). > Regretfully, the application of the rules: > > Sin[\[Theta]_ + \[Pi]/6] -> -Cos[\[Theta] + (2 \[Pi])/3] > Sin[\[Theta]_ - \[Pi]/6] -> Cos[\[Theta] - (2 \[Pi])/3] > > results in a flop, since sine functions stubbornly appear again! > > Can you help me? > > Thank you in advance > > Mauro