# How to replace the argument of a function?

For the following expression,

b'[x y/z]+z b''[x y/z]


I want to replace the argument of b such that the above expression becomes

b'[z]+z b''[z]


How can I do that ?

• Note that if xy is intended to be the product of x and y then it should be entered as either x y (implicit product with a space) or as x*y (explicit product). – Bob Hanlon May 30 '16 at 14:21

As a general case where you want to replace all the arguments,

(b'[x y/z] + z b''[x y/z]) /. Derivative[n_][b_][x_] :> Derivative[n][b][z]


z b''(z)+b'(z)

No matter what was your previous argument, it will be replaced by z.

b'[xy/z] + z b''[xy/z] /. {xy/z -> z}


gives me an output of

b'[z]+z b''[z]


Is that what you meant?