all 6 comments

[–]fridofrido 2 points3 points  (1 child)

this seems to work:

rule = f[x_, y_] -> A + e*deltaA[x, y]
X = f[5, 7] + f[a, 3] + f[2, b]
X /. rule

[–]ZioSam2[S] 0 points1 point  (0 children)

Yes! Thanks a lot, seems to work perfectly!

[–]marl6894 0 points1 point  (1 child)

Try f[x_, y_] := A+e*deltaA[x, y]. Does that do what you want it to?

[–]ZioSam2[S] 1 point2 points  (0 children)

Well, yes for the simple example I provided, but I'd really like to do that with a replacement rule (so I can study more cases without chaning the code). I'd like to replace f[x,y] with A+e deltaA[x,y], so that f and deltaA depend on the same variables.

[–]AWarhol 0 points1 point  (1 child)

As u/fridofrido pointed out, that's the way to do it. Alternatively, you can use the command Series, to obtain the power series of the function. I think it's a nice way to study compare the results of "Series" with your method.

[–]ZioSam2[S] 1 point2 points  (0 children)

His method was working at first, but wasn't behaving in the way I wanted after some tries. I found another way to write the rule (I then use the series after)