Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8725

Re: Extensive replacement of trigonometric functions

From Dana DeLouis <dana01@me.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Extensive replacement of trigonometric functions
Date 2012-02-25 06:54 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jia0ik$183$1@smc.vnet.net> (permalink)

Show all headers | View raw


> 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...@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


Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Extensive replacement of trigonometric functions Dana DeLouis <dana01@me.com> - 2012-02-25 06:54 +0000
  Re: Extensive replacement of trigonometric functions Mauro <pippo@hotmail.com> - 2012-02-29 12:30 +0000

csiph-web