Source
Adapted from my own handwritten and hand-typed notes from Year 1 to Year 3 of my EEE degree
A single op-amp with through into (feedback ) and through the divider , into . It is solved with superposition, treating it as an inverting stage plus a non-inverting stage.
Scaling Subtractor Circuit

Superposition
Step 1, kill : no current flows in , so and the circuit is an inverting amplifier.
Step 2, kill : goes to ground and the circuit is a non-inverting amplifier with a divider input.
Total:
Difference Amplifier
If the ratios match, , then and the term becomes :
Special cases:
- and : difference amplifier with gain
- all four resistors equal: , a plain subtractor
Quick Check
kΩ, kΩ, V, V gives V. Only the difference is amplified.
Replacing a resistor by a capacitor gives the Op-Amp Integrator and Differentiator.