MathGroup Archive 2003

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

Search the Archive

Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44823] Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?
  • From: drbob at bigfoot.com (Bobby R. Treat)
  • Date: Wed, 3 Dec 2003 04:24:05 -0500 (EST)
  • References: <bq5b08$k05$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Mathematica doesn't compute things so much as apply substitution
rules. For Divide there's a rule that says Sin[x_]/Cos[x_]:>Tan[x].
The opposite is also true, so to prevent an infinite loop, Mathematica
stops with the simplest expression it can find. Tan[x] is simpler than
the other expression (smaller leaf count, smaller tree depth, smaller
bytecount, whatever), so that's what it gives you.

Ted Ersek recently told us about a package (HoldTemporary) that will
help:

http://library.wolfram.com/infocenter/MathSource/705/

Bobby

AES/newspost <siegman at stanford.edu> wrote in message news:<bq5b08$k05$1 at smc.vnet.net>...
> The Mathematica Book says "Mathematica automatically uses functions like 
> Tan whenever it can" and shows as an example that Sin[x]^2/Cos[x] is 
> converted to  Sin[x] Tan[x] .
> 
> Any simple way to stop this in displaying the output of a symbolic 
> calculation?  
> 
> The obvious attempt of applying /.Tan[x]->Sin[x]/Cos[x] doesn't seem to 
> do what's wanted.
> 
> [And out of curiousity, WHY does it do this?  That is, why is Tan 
> apparently given a higher priority than Cos?]


  • Prev by Date: problem running mathematica 4 kernel on 486
  • Next by Date: Comparison of Mathematica on Various Computers
  • Previous by thread: Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?
  • Next by thread: Re: Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?