1

Why does the following equation:

E^(I*theta) === Cos[theta] + I*Sin[theta]

yield false, in terms of Euler's Identity?

Jmeeks29ig
  • 1,447
  • 7
  • 13
  • 2
    Try Simplify[E^(I*theta) == Cos[theta] + I*Sin[theta]]. Note SameQ (===) means identical expressions (as in, identical code). It does not test mathematical equivalence. Equal (==) can do that, but it is reluctant to try all but the simplest transformation. Hence, you often have to use Simplify to test mathematical equality. – Michael E2 Feb 08 '20 at 18:40
  • 1
    Related: https://mathematica.stackexchange.com/questions/8796/evaluating-an-if-condition-to-yield-true-false, https://mathematica.stackexchange.com/questions/201808/why-is-this-not-false-sameq-equal-set . Possible duplicate: https://mathematica.stackexchange.com/questions/115303/testing-equivalence-of-analytical-expressions-like-x2-x-xx-1 – Michael E2 Feb 08 '20 at 18:41
  • 1

1 Answers1

3
Simplify[E^(I*theta) == Cos[theta] + I*Sin[theta]]
(* True *)

=== is structural identity, not mathematical. == is mathematical equality. Mathematica only does simple reductions automatically: this is a case where you need to ask it to try a little harder than usual.

John Doty
  • 13,712
  • 1
  • 22
  • 42