Re: How to force ( Exp[I x]/2+Exp[-I x]/2=cos(x) ) ?
- To: mathgroup at smc.vnet.net
- Subject: [mg3430] Re: [mg3402] How to force ( Exp[I x]/2+Exp[-I x]/2=cos(x) ) ?
- From: Dave Snead <76300.3545 at compuserve.com>
- Date: Thu, 7 Mar 1996 02:23:15 -0500
- Sender: owner-wri-mathgroup at wolfram.com
yjtsai at leland.Stanford.EDU (Yeou-Jyh Tsai) writes > Hello, > > I use Mathematica's MatrixExp to generate the symbolic form of > a matrix's exponential. It gives me lots of > I x -I x -I x I x > E E I E IE > --- + ------ and -------- - ----- > 2 2 2 2 > which should be converted to Cos[x] and Sin[x], respectively. Does anyone > know how to do this ? > > Thanks a lot! > > Yeou-Jyh Tsai > tsai at relgyro.stanford.edu Try ComplexExpand; it assumes all variables are real. In[10]:= {Exp[I x]/2 + Exp[-I x]/2, I Exp[-I x]/2 - I Exp[I x]/2} // ComplexExpand Out[10]= {Cos[x], Sin[x]} Good Luck, Dave Snead 76300.3545 at compuserve.com ==== [MESSAGE SEPARATOR] ====