I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing.
Sqrt[f[x, y]] /. f[___] -> u
However, if I replace f with
Sqrt[Plus[x, y]] /. Plus[___] -> u
instead of returning
Sqrt[u], Mathematica gives
a*Sqrt[x] /. Sqrt[_] -> u
However, if the input is
a/Sqrt[x] /. Sqrt[_] -> u
Instead of returing a/u, Mathematica returns
I'm really confused. Can anybody shed some light on the behavior of this function?