Op-Amp Superposition
Those voltages are on the input stage of an instrumentation amplifier.  Usually, you see the difference (Vout2-Vout1) carried through the whole derivation, as this amp has a differential input.

The way to understand the circuit is to realize that the resistor Rg has voltage V2 on one side and V1 on the other, thus you know the current through Rg is $$I_{Rg}=(V2-V1)/Rg,$$ going from the bottom of the diagram to the top. R1 and R2 have the SAME current through them, thus you know Vout1 and Vout2. $$(V_{out2} - V2)/R_1 =(V_1-V_{out1})/R_2=I_{Rg}$$