Math Term Question

<p>I’ve always been confused about the meaning of “substitute this for that”. </p>

<p>When we say “Substitute X for Y”, do we mean “Y will replace X” or the other way around?</p>

<p>Also, when we say “Substitute X by Y”, do we mean “X will replace Y” or “Y will replace X”?</p>

<p>For “Substitute X for Y” it means X will replace Y.
For “Substitute X by Y” it means Y will replace X.</p>