MathGroup Archive 2004

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

Search the Archive

Re: how to test if 2 expressions are the same? Mathematica 5.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46108] Re: how to test if 2 expressions are the same? Mathematica 5.0
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Fri, 6 Feb 2004 04:15:34 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 2/5/04 at 4:02 AM, nma124 at hotmail.com (steve_H) wrote:


>for example, we know that 1-sin^2(x) = cos^2(x), and 
>a*log(x)=log(x^a), etc.., but sometimes this does not seem to work
>using SameQ:

>SameQ[a Log[x], Log[x^a] ] False

>I tried MatchQ and that also gives False.

And the reason is a Log[x] is not the same as Log[x^a]. Niether MatchQ nor SameQ will evaluate as True when the heads of the expressions differ. The head of a Log[x] is Times and the head of Log[x^a] is Log. And that causes SameQ to return False.

--
To reply via email subtract one hundred and four


  • Prev by Date: queation exporting quaternions from mathematica 5
  • Next by Date: Find last NZ in list
  • Previous by thread: how to test if 2 expressions are the same? Mathematica 5.0
  • Next by thread: Re: how to test if 2 expressions are the same? Mathematica 5.0