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: [mg44835] Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?
  • From: Greg Frascadore <ephemeral17 at silk.com>
  • Date: Wed, 3 Dec 2003 04:24:20 -0500 (EST)
  • References: <bq5b08$k05$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In <bq5b08$k05$1 at smc.vnet.net> AES/newspost  wrote:
> 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?]

If you just need to transform the output, try this:

  mystyle[x_] := x /. (Tan[y_] -> HoldForm[Sin[y]/Cos[y]])

Then
  In[1]:= Sin[x]^2 / Cos[x] // mystyle

-Greg


  • Prev by Date: Nested Functions
  • Next by Date: Re: NIntegrate
  • Previous by thread: RE: Nested Functions
  • Next by thread: Re: How to NOT convert Sin[x]/Cos[x] to Tan[x] ?