The difference amplifier, or subtractor, produces an output proportional to the difference of two independent input signals. One signal V1 is applied through a resistor to the inverting (−) input with feedback resistor Rf; the other signal V2 is applied through a resistor to the non-inverting (+) input, which is also returned to ground through a resistor.
The output is found by superposition — treating each input's effect separately (the inverting input acts as an inverting amplifier, the non-inverting input acts through the divider and non-inverting gain) and adding the results:
Vo=−R1RfV1+(1+R1Rf)(R2+R3R3)V2
When the resistor pairs are matched (the inverting side R1=Rf and the non-inverting side R2=R3), this collapses to the clean, symmetric result:
Vo=V2−V1
so the circuit is a unity-gain subtractor. For example, with V1=1 V and V2=−1 V the output is −1−1=−2 V; with V1=−1 V and V2=1 V it is 1−(−1)=+2 V.
Matching the resistors is essential: any mismatch lets part of a common-mode signal appear at the output, degrading the rejection of noise. The subtractor is therefore the core of instrumentation amplifiers, which measure a small difference sitting on top of a large common-mode voltage.