Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Preventing Times[x,x] from becoming Power[x,2]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53668] Re: [mg53661] Preventing Times[x,x] from becoming Power[x,2]
  • From: yehuda ben-shimol <benshimo at bgumail.bgu.ac.il>
  • Date: Sat, 22 Jan 2005 03:51:51 -0500 (EST)
  • References: <200501211137.GAA01454@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Josef Karthauser wrote:

>I was wondering whether anyone knows the answer to this one.
>
>I've got a function, let's call it F[...]. If I enter F[s] F[s]
>into mathematica it "simplifies" the resulting expression, making it
>become Power[F[s],2].  Is there any way to prevent this automatic
>simplification on F[] objects?
>
>Joe
>  
>
You can use upvalues and HoldForm[]

f[x_] f[x_]^=HoldForm[f[x] f[x]]

Now when you use it  as in
f[a+b+c] f[a+b+c]
it will not be simplified to f[a+b+c]^2 and will be displayed as you wanted
yehuda


  • Prev by Date: Re: Function Fitting To 3D Data
  • Next by Date: Re: symbolic complex expressions
  • Previous by thread: Preventing Times[x,x] from becoming Power[x,2]
  • Next by thread: Re: Preventing Times[x,x] from becoming Power[x,2]