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

*To*: mathgroup at smc.vnet.net*Subject*: [mg46095] Re: how to test if 2 expressions are the same? Mathematica 5.0*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Fri, 6 Feb 2004 04:15:18 -0500 (EST)*Organization*: Universitaet Leipzig*References*: <bvt135$oj5$1@smc.vnet.net>*Reply-to*: kuska at informatik.uni-leipzig.de*Sender*: owner-wri-mathgroup at wolfram.com

Hi, first of all for complex x the expressions, a*Log[x] and Log[x^a] are *not* the same. SameQ[] tests to an identity and it does no simplifications that might be possible. That's the reason why 1 - Cos[phi]^2 == Sin[phi]^2 is unevaluated while 1 - Cos[phi]^2 == Sin[phi]^2 // FullSimplify return True. Regards Jens steve_H wrote: > > hello; > > I am confused. > > many times, I want to find if there is a way to obtain one expression > from another by tranformation. > > 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. > > what is the right way to do these things in Mathematica? I checked the on-line help, > and can't seem to see the right command for this. > > many thanks, > STeve