Skip to main content
added 3 characters in body
Source Link

Will this work for you?Holding the pattern works:

diffy := Hold[D[U[z], z]]
held = diffy /. U[z] :> Exp[-I*k*z]

Edit for completeness:

held // ReleaseHold

Will this work for you?

diffy := Hold[D[U[z], z]]
held = diffy /. U[z] :> Exp[-I*k*z]

Edit for completeness:

held // ReleaseHold

Holding the pattern works:

diffy := Hold[D[U[z], z]]
held = diffy /. U[z] :> Exp[-I*k*z]

Edit for completeness:

held // ReleaseHold
Source Link

Will this work for you?

diffy := Hold[D[U[z], z]]
held = diffy /. U[z] :> Exp[-I*k*z]

Edit for completeness:

held // ReleaseHold