(N/A) Relative velocity is the velocity of an object with respect to another observer or frame of reference.
Case $1$: Two observers and one moving object:
Let $A$ be the frame of reference associated with a person standing on the ground. $B$ is the frame of reference associated with a train moving with uniform velocity. Both are inertial frames.
From the figure,$x_{PA} = x_{PB} + x_{BA}$.
Differentiating with respect to $t$:
$\frac{d x_{PA}}{d t} = \frac{d x_{PB}}{d t} + \frac{d x_{BA}}{d t}$
Since $\frac{d x_{PA}}{d t} = v_{PA}$,$\frac{d x_{PB}}{d t} = v_{PB}$,and $\frac{d x_{BA}}{d t} = v_{BA}$,we get:
$v_{PA} = v_{PB} + v_{BA}$
$\therefore v_{PB} = v_{PA} - v_{BA}$
Where $v_{PA}$ is the velocity of $P$ w.r.t. frame $A$,$v_{PB}$ is the velocity of $P$ w.r.t. frame $B$,and $v_{BA}$ is the velocity of frame $B$ w.r.t. frame $A$.
Case $2$: One observer and two moving objects:
Let two objects $A$ and $B$ move with velocities $v_A$ and $v_B$ with respect to a ground observer $G$. The position vectors are $r_A$ and $r_B$. The relative position of $B$ with respect to $A$ is $r_{BA} = r_B - r_A$. Differentiating with respect to time,we get the relative velocity of $B$ with respect to $A$ as $v_{BA} = v_B - v_A$.