Subtracting Vectors

Subtraction is addition with a flipped arrow. The vector -\vec{v} is just \vec{v} turned around to point the opposite way, so we define

\vec{u} - \vec{v} = \vec{u} + (-\vec{v}).

In components, subtract the matching entries:

\begin{bmatrix} u_x \\ u_y \end{bmatrix} - \begin{bmatrix} v_x \\ v_y \end{bmatrix} = \begin{bmatrix} u_x - v_x \\ u_y - v_y \end{bmatrix}.

The arrow from one tip to the other

There's a lovely picture for the difference. Draw \vec{u} and \vec{v} from the same origin. Then \vec{u} - \vec{v} is the arrow that runs from the tip of \vec{v} to the tip of \vec{u} — the displacement that takes you from \vec{v} to \vec{u}. (Memory hook: it points to the first one named.)

Why this matters

The difference of two position vectors is the displacement between the two points — the single most common thing you'll ever do with vectors. "How do I get from A to B?" is answered by \vec{B} - \vec{A}. In machine learning the same difference measures the error between a prediction and a target, and its length is the gap you try to shrink.