Question: substitute properly

Hi, I'm wondering why the first substituion works, but not the second. Can someone explain?

Please Wait...