Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: [Q] Implementing identities as rules

  • To: mathgroup at
  • Subject: [mg18675] Re: [Q] Implementing identities as rules
  • From: Paul Abbott <paul at>
  • Date: Thu, 15 Jul 1999 01:45:57 -0400
  • Organization: University of Western Australia
  • References: <7meirr$>
  • Sender: owner-wri-mathgroup at

Kevin Jaffe wrote:

> Is there a way to instruct Mathematica not to evaluate the expression
> after the replacement has been made?

One way is to use HoldForm:

In[1]:= f = Function[{x, y}, Exp[x^2 + y^2]]; 

In[2]:= D[f[x, y], x] /. Exp[a_^2 + b_^2] :> HoldForm[f][a, b]
Out[2]= 2 x f[x, y]

In[3]:= ReleaseHold[%]
    2    2
   x  + y
2 E        x

Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia           
Nedlands WA  6907                     mailto:paul at 

            God IS a weakly left-handed dice player

  • Prev by Date: Re: trouble with greek letter output to EPS
  • Next by Date: Re: Kronecker product of matrices
  • Previous by thread: Re: [Q] Implementing identities as rules
  • Next by thread: Rationalizing the denominator