Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

ComplexExpand and subscrips

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109559] ComplexExpand and subscrips
  • From: "slawek" <slawek at host.pl>
  • Date: Wed, 5 May 2010 06:06:02 -0400 (EDT)

Why the Out[4] and Out[2] are quite different? The eq is a sample and has 
got no deep meaning.

In[1]:= eq = p1[x] + I p2[x] + Sin[p1[x] - I p2[x]]
Out[1]= p1[x] + I p2[x] + Sin[p1[x] - I p2[x]]
In[2]:= Re[eq] // ComplexExpand
Out[2]= p1[x] + Cosh[p2[x]] Sin[p1[x]]
In[3]:= eq /. {p1 -> Subscript[p, 1], p2 -> Subscript[p, 2]}
Out[3]= Sin[Subscript[p, 1][x] - I Subscript[p, 2][x]] + Subscript[p, 1][x] 
+ I Subscript[p, 2][x]
In[4]:= Re[  eq /. {p1 -> Subscript[p, 1],   p2 -> Subscript[p, 2]}] // 
ComplexExpand
Out[4]= -Im[Subscript[p, 2][x]] + Re[Subscript[p, 1][x]] + 
Cosh[Im[Subscript[p, 1][x]] - Re[Subscript[p, 2][x]]] Sin[Im[Subscript[p, 
2][x]] + Re[Subscript[p, 1][x]]]

TIA
slawek
 



  • Prev by Date: Re: Plot this?
  • Next by Date: DistributeDefinitions statement appears to create memory leak
  • Previous by thread: Re: A question about saving figures from Mathematica 7
  • Next by thread: Re: ComplexExpand and subscrips