MathGroup Archive 1999

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

Search the Archive

Re: Can someone explain why Mathematica is doing this?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19140] Re: [mg19113] Can someone explain why Mathematica is doing this?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 5 Aug 1999 23:58:43 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Benjamin,

Mathematica does automatically make the simplification, undoing the substitution.

You could wrap Sin[x] and Cos[x] in HoldForm which would prevent the simplification,
then use ReleaseHold when you want to fully evaluate. Or you could use sin[x]/cos[x]
and then substitute the real names when you want to fully evaluate.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


>I'm running Mathematica v3.0.1.1x (or something like that) on a Macintosh.  I want
>to replace Tan[something] with Sin[something]/Cos[something].  The obvious
>substitution (see below) didn't work.  Other substitutions work fine, but
>this one just sits there.  Perhaps (it has just occured to me) Mathematica is
>making the substitution, but then "simplifying" Sin/Cos->Tan.  However, I
>want to make other substitutions (to check some algebra that I'm doing by
>hand).  How can I make Mathematica do this?
>
>Thanks in advnace,
>-Ben
>
>
>In[6]:=Tan[x]/.Tan[z_]->Sin[z]
>
>Out[6]=Sin[x]
>
>In[7]:=Tan[x]/.Tan[z_]->z Sin[z]
>
>Out[7]=x Sin[x]
>
>In[8]:=Tan[x]/.Tan[z_]->Sin[z]Cos[z]
>
>Out[8]=Cos[x] Sin[x]
>
>In[9]:=Tan[x]/.Tan[z_]->Sin[z]/Cos[z]
>
>Out[9]=Tan[x]
>
>--
>-------------------------------------------------------------------
>  Benjamin Lotto                 *
>  Department of Mathematics      *  e-mail:  belotto at vassar.edu
>  Vassar College, Box 349        *  phone:  914-437-7180
>  124 Raymond Avenue             *  fax:  914-437-7065
>  Poughkeepsie, NY 12604-0349    *
>-------------------------------------------------------------------
>      WWW:  <http://math.vassar.edu/faculty/lotto/lotto.html>
>-------------------------------------------------------------------
>
>



  • Prev by Date: RE: Re: Packed Arrays in version 4
  • Next by Date: RE: Mathematica References for Efficient Programming?
  • Previous by thread: Can someone explain why Mathematica is doing this?
  • Next by thread: DSolve Bessels