Op-Amp Math Circuits: Four Topologies and Their Limits
Op-Amp Math Circuits: Sum, Difference, Integration and Differentiation
Author: Vivi Peng | Published for icallin.com | Updated: October 27, 2026
Op-amp math circuits use resistors and capacitors around an operational amplifier to combine voltages, extract a difference, accumulate a signal over time or respond to its rate of change. The external feedback network determines the mathematical operation. The usable result also depends on the amplifier remaining linear and stable within the intended signal range.
These four configurations are useful in mixers, measurement interfaces, waveform circuits and control loops. Understanding their equations is the starting point; understanding where those equations stop applying is what makes them useful on a PCB.
Begin with the feedback assumptions
For the following equations, assume an ideal amplifier under negative feedback, negligible input current and sufficient loop gain for the two input voltages to be nearly equal. Ground is the signal reference unless otherwise stated. These assumptions fail when an input exceeds the permitted common-mode range, the output clips, or the loop becomes unstable.
An inverting input held close to ground by feedback is a virtual ground. It is not a physical ground connection and cannot be treated as a general-purpose return node. The resistor currents meet there, while the amplifier output moves to satisfy the feedback relationship.
Add signals with an inverting summer
For a summing amplifier, connect each input voltage through its own resistor to the inverting node, place Rf between output and that node, and connect the non-inverting input to the reference. With ground as the reference:
Vout = -Rf × (V1/R1 + V2/R2 + ... + Vn/Rn)
Each input has an independently selected weight of -Rf/Rn. Equal input resistors produce equally weighted contributions, but a unity-weight negative sum requires the feedback resistor to equal those resistors as well. Equal input resistors alone do not establish unity weighting.
TI's inverting summer design also identifies source impedance as a design condition. Resistance in a signal source adds to its input path and changes the intended weight. Allocate output range for the largest combined signal, including simultaneous peaks; testing each channel separately can miss clipping when channels are combined.
Measure a difference with matched ratios
A four-resistor difference amplifier uses both inputs while retaining negative feedback. Define R1 from V1 to the inverting input, R2 as feedback, R3 from V2 to the non-inverting input, and R4 from that input to ground. If:
R2/R1 = R4/R3 = k
then the ideal result is:
Vout = k × (V2 - V1)
The output here is a single voltage representing the difference. A conventional op-amp does not need open-loop operation to perform subtraction. TI's difference amplifier design demonstrates the closed-loop circuit and its resistor-network constraints.
Ratio mismatch allows a voltage shared by both inputs to appear at the output. Resistor ratio matching requires checking tolerance and temperature tracking rather than selecting resistors only by nominal resistance. Source impedance contributes to the effective ratios too. Analog Devices' difference amplifier analysis further shows why unequal filtering and PCB parasitics can degrade rejection as frequency increases. Adding a capacitor on one side alone can change the subtraction accuracy.
Integrate within a defined frequency band
Replace the summer's feedback resistor with a capacitor C and use one input resistor R. The ideal inverting op-amp integrator, including its starting output as explained in Microchip's integrator tutorial, follows:
Vout(t) = Vout(t0) - (1/RC) × integral[Vin(t) dt, from t0 to t]
A positive constant input creates a falling output ramp. Alternating positive and negative input levels produce opposite slopes, which explains the familiar square-to-triangle conversion. The initial capacitor voltage establishes the starting output.
Small DC errors accumulate as well. Offset voltage, bias current and any DC component in the signal can eventually drive the output into saturation. A resistor Rf in parallel with C supplies a DC feedback path. For this practical circuit:
H(s) = -(Rf/R) / (1 + sRfC)
Integration is approached when the signal frequency is well above 1/(2πRfC), while remaining within the amplifier's useful loop bandwidth. Below that corner, the circuit approaches a finite-gain inverting amplifier. TI's integrator design guidance explains this lower-frequency limit and the alternative of providing DC feedback through a larger servo loop.
Figure 1. Four mathematical operations produced by feedback networks. Integration and differentiation apply over designed frequency bands; their polarity follows the inverting implementations described here.
Differentiate without extending gain indefinitely
An ideal op-amp differentiator places capacitor C in the input path and resistor Rf in feedback:
Vout(t) = -RfC × dVin(t)/dt
Output depends on slope. A rising ramp creates a negative output level; a falling ramp produces a positive one. Rapid changes produce larger responses, which can make differentiation useful for detecting transitions or measuring a rate of change.
That rising response also emphasizes high-frequency noise. A practical implementation adds an input series resistor, a feedback capacitor, or both to limit the response and obtain stability. TI's differentiator circuit makes clear that the ideal network needs modification and that the added components restrict its differentiation band. Choose that band from the signal you want to measure, then verify loop behavior with the selected amplifier and load.
Preserve the operation in the PCB layout
| Operation | Main accuracy condition | Useful validation |
|---|---|---|
| Sum | Correct input-to-feedback ratios | Apply inputs separately, then together |
| Difference | Matched ratios and valid input range | Apply equal inputs and inspect residual output |
| Integrate | Defined DC behavior and integration band | Check drift and ramp slope |
| Differentiate | Limited bandwidth and stable feedback | Check response to ramps and added noise |
Table 1. Accuracy and validation priorities for the four feedback operations described above.
For op-amp math circuits, keep feedback components close to the amplifier and keep fast digital activity away from sensitive input nodes. Check bypassing and return paths against the device's layout guidance. Capacitor leakage and dielectric behavior matter when charge storage determines the operation, while resistor and capacitor tolerances set gain or time-constant error.
Dual supplies are convenient for signals centered on ground, but they are not mandatory. A single-supply implementation can use a suitable reference with input and output ranges translated around it. Analog Devices' single-supply and rail-to-rail tutorial explains why actual input range and output headroom still need checking. Include worst-case amplitude, frequency, slew rate and load in the validation. The circuit-model sanity checks help review a simulated response before comparing it with hardware.
Frequently Asked Questions
Why does an integrator output drift with no intended input?
DC errors still charge the feedback capacitor. Provide a DC feedback or reset mechanism appropriate to the application, and check amplifier offset, input bias current and capacitor leakage.
Is a difference amplifier automatically an instrumentation amplifier?
No. A four-resistor subtractor has input loading set by its resistor network. Instrumentation amplifier architectures provide additional input and gain behavior that must be assessed separately.
Conclusion
Useful op-amp math circuits combine the intended equation with a defined operating range. Choose the resistor ratios and frequency band, preserve a stable feedback path, and check output headroom and loading before accepting the result.
Written by Vivi Peng for icallin.com.
Need help with PCB manufacturing or PCBA assembly?
Submit the PCB manufacturing or PCBA assembly requirements for your analog circuit through icallin's quotation page.



















