We can replace (substitute) by Symbolic Math Tools not only Variable but Function name too – see. Fig. 251.
Mathcad-sheet