Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: Logical evaluation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82276] Re: [mg82249] Logical evaluation
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 17 Oct 2007 03:48:51 -0400 (EDT)
  • References: <200710160727.DAA08825@smc.vnet.net>

On 16 Oct 2007, at 16:27, Michael Mandelberg wrote:

> I can't figure out why the following does not evaulate to TRUE:
>
> In[100]:= \[ExponentialE]^(-\[ImaginaryI] x) + \[ExponentialE]^(\
> \[ImaginaryI] x) == 2 TrigToExp[Cos[x]]
>
> Out[100]= \[ExponentialE]^(-\[ImaginaryI] x) + \[ExponentialE]^(\
> \[ImaginaryI] x) ==
>  2 (\[ExponentialE]^(-\[ImaginaryI] x)/
>     2 + \[ExponentialE]^(\[ImaginaryI] x)/2)
>
> Any ideas?
>
> Michael Mandelberg
>
>


Because Mathematica (rather naturally) does not automatically apply  
the distributive law for multiplication:

E^((-I)*x) + E^(I*x) == 2*TrigToExp[Cos[x]]
E^((-I)*x) + E^(I*x) == 2*(1/(E^(I*x)*2) + E^(I*x)/2)
Distribute /@ %
True

(You can also use ExpandAll or in Mathematica 6 just Expand)

Andrzej Kozlowski


  • Prev by Date: Palette for Units Conversion
  • Next by Date: Re: Logical evaluation
  • Previous by thread: Logical evaluation
  • Next by thread: Re: Logical evaluation