MathGroup Archive 1998

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

Search the Archive

RE: Re: how to replace...?




Suppose you have (2 f[y]-f[x]+1)/(y-x), and you want to treat
(f[y]-f[x])/(y-x) as f'[x].

Then you can get the desired result using the following:

In[1]:=
soln=Eliminate[{dummy==(2  f[y]-f[x]+1)/(y-x),
f'[x]==(f[y]-f[x])/(y-x)}, {dummy}] ;

In[2]:=
expr=Part[soln,2]/.(lhs_==rhs_)->rhs-lhs;

In[3]:=
Simplify[expr]

Out[3]=
  -f[x]+f[y]+(x-y)f'[x]


Ted Ersek

|
|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 Abbott




  • Prev by Date: A Bug / Feature
  • Next by Date: Re: graphics question
  • Prev by thread: Re: how to replace...?
  • Next by thread: How does a rule get applied?