MathGroup Archive 1996

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

Search the Archive

Re: Trig Simplifications

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3707] Re: Trig Simplifications
  • From: ianc (Ian Collier)
  • Date: Wed, 10 Apr 1996 02:11:22 -0400
  • Organization: Wolfram Research, Inc.
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4ka54g$sai at dragonfly.wolfram.com>, Alexander Casti
<arc at carmen.phys.columbia.edu> wrote:

> Basically my question is how to get mathematica to write
> 
> Exp[I x] in place of Cos[x] + I Sin[x]
> 
> Suppose I have the expression  
> 
> In[1]: f[x_]= Cos[x] + I Sin[x] - Cos[2 X] + I Sin[2 X]
> 
> I would like mathematica to simplify this into
> 
> f[x_]= Exp[I X] - Exp[2 I X]
> 
> I tried the substitution command
> 
> In[2]: % ./ Cos[X]+I Sin[X]-> Exp[I X] and it returned
> Out[2]: E^{I X}  - Cos[2 X] + I Sin[2 X]
> 
> So, it seems as though this simple minded approach is not
> enough for mathematica to understand the substitution rules
> for powers of complex exponentials other than the one I 
> explicitly gave.
> In addition, commands like Simplify[Blah] do not seem to do
> the trick either.  I believe I have the trigonometry package
> loaded in (via the command Needs["Algebra`Trigonometry`"]).
> What must I do ? 
> 
> Thanks for your time.
> 
> Alex

You can do this using the function TrigToComplex which
is defined in Algebra`Trigonometry`, one of the standard
packages distributed with Mathematica. Here is an example:


In[1]:=
    Needs[ "Algebra`Trigonometry`" ]

In[2]:=
    expr = Cos[x] + I Sin[x]
Out[2]=
    Cos[x] + I Sin[x]

In[3]:=
    TrigToComplex[ expr ]
Out[3]=
      -I x    I x    -I x    I x
    -E     + E      E     + E
    ------------- + ------------
          2              2

In[4]:=
    Simplify[%]
Out[4]=
     I x
    E

This is documented in more detail on pages 15-17 of "The
Guide to Standard Mathematica Packages" Technical Report.

I hope this helps.

--Ian

-----------------------------------------------------------
Ian Collier
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217) 398-0700   fax:(217) 398-0747    ianc at wolfram.com
Wolfram Research Home Page:         http://www.wolfram.com/
-----------------------------------------------------------

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: {mg3701] Re: Problem with Diff. Equation
  • Next by Date: Re: Trig Simplifications
  • Previous by thread: Trig Simplifications
  • Next by thread: Re: Trig Simplifications