This is a snipet from the book Design of Analog CMOS Integrated Circuits (page 112).
This is analysis of differential pair.
For \$g_{m1} = g_{m2} = g_m\$, reduces to
$$\begin{equation} (V_X − V_Y ) = −g_m R_D V_{in1} \tag{4.21} \end{equation}$$
By virtue of symmetry, the effect of Vin2 at X and Y is identical to that of Vin1 except for a change in the polarities: \$ (V_X − V_Y ) = g_m R_D V_{in2} \tag{4.22} \$
Adding the two sides of (4.21) and (4.22) to perform superposition, we have $$\frac{V_X - V_Y}{V_{in1}-V_{in2}} = -g_m R_D$$
Well, adding two sides together will give us the following. I have no idea why the book give us the equation above.
$$2(V_X - V_Y) = g_m R_D (V_{in2}-V_{in1})$$
$$\Rightarrow \frac{V_X - V_Y}{V_{in1}-V_{in2}} = -g_m R_D/2$$