Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Extensive replacement of trigonometric functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125153] Re: Extensive replacement of trigonometric functions
  • From: Dana DeLouis <dana01 at me.com>
  • Date: Sat, 25 Feb 2012 01:53:16 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

> 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!

Hi.  I don't have a good solution, but perhaps a workaround using HoldForm...

Here's a made up equation with both of your Sin examples.

equ = (Sin[x + Pi/6] + 3*Tan[x] + Sqrt[2]) / (Cos[x - 1/2] + Sin[x - Pi/6]); 

I used just 1 rule for Sin vs your 2 rules.

rule1 = Sin[x___]:>cos[Pi/2-x];
rule2 = cos[x___]:>HoldForm[Cos[x]];


equ /.rule1 /.rule2

(Sqrt[2]+Cos[Pi/3-x]+3 Tan[x]) / (Cos[1/2-x]-Cos[Pi/3+x])

To go back to using Sin, use:
ReleaseHold[%]

The following -- almost worked--, but it didn't simplify the terms inside the function.
I don't know why. 

NoSin[e_]:=100*Count[e,_Sin,{0,Infinity}]

FullSimplify[equ, ComplexityFunction -> NoSin]

(Sqrt[2]+Cos[1/3 (Pi-3 x)]+3 Tan[x])/(Cos[1/2 (1-2 x)]-Cos[1/3 (Pi+3 x)])


= = = = = = = = = = = =
HTH  :>)
Dana DeLouis
Mac, Math 8.0
= = = = = = = = = = = =



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





  • Prev by Date: R: Re: good list
  • Next by Date: Re: Executing a Notebook and saving the modified Notebook - all without the GUI
  • Previous by thread: Re: Extensive replacement of trigonometric functions
  • Next by thread: Re: Extensive replacement of trigonometric functions