Re: how to replace...?
- To: mathgroup@smc.vnet.net
- Subject: [mg12460] Re: how to replace...?
- From: Paul Abbott <paul@physics.uwa.edu.au>
- Date: Tue, 19 May 1998 13:31:29 -0400
- Organization: University of Western Australia
- References: <6jf035$3cu@smc.vnet.net>
Yacine Ait-Sahalia wrote: > What should I do to systematically replace the limit > > (f[y]-f[x])/(y-x) /. y->x Note that the use of a replacement rule, i.e., y->x is _not_ the same as taking a limit. > by f'[x], no matter what the function f is? In the most trivial cases, the following pattern will work: In[1]:= (g[a]-g[b])/(a-b) /. (f_[y_]- f_[x_])/(y_- x_) -> f'[y] Out[1]= g'[a] However, if these terms are part of a more complicated expression this simple pattern will not work. The best answer probably depends on the exact form of the expressions you are trying to simplify. Cheers, Paul ____________________________________________________________________ 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@physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________