The ideal closed-loop gain equation for op amp circuits depends entirely on your feedback topology. For a non-inverting configuration, the voltage gain is Av = 1 + (Rf / Ri). For an inverting configuration, it is Av = -(Rf / Ri). While these formulas assume an ideal op-amp with infinite open-loop gain, real-world components like the TL072 or OPA211 introduce finite open-loop gain errors, thermal noise, and bandwidth limits that you must calculate to avoid saturated outputs and noisy signals.

The Core Gain Equation for Op Amp: Symbols and Definitions

Before deriving the math, we need to lock in the exact variables. The gain equation for op amp circuits is dimensionless, but the inputs and outputs carry strict voltage units. Below is the definitive symbol table for both ideal and real-world closed-loop calculations.

Symbol Parameter Unit Typical Real-World Range
Av Closed-Loop Voltage Gain Dimensionless (V/V) 1 to 1,000
Vout Output Voltage Volts (V) Constrained by supply rails (e.g., ±12V)
Vin Input Voltage Volts (V) µV to low single-digit Volts
Rf Feedback Resistor Ohms (Ω) 1 kΩ to 1 MΩ
Ri Input / Ground Resistor Ohms (Ω) 1 kΩ to 100 kΩ
AOL Open-Loop Gain Dimensionless (V/V) 100,000 to 10,000,000 (100 dB to 140 dB)
β Feedback Factor Dimensionless Ri / (Ri + Rf)

Real-World Resistor Pairs for Target Gains

Theory assumes you can buy a 99.000 kΩ resistor. In practice, you are restricted to standard E24 (5% tolerance) or E96 (1% tolerance) series values. More importantly, high-value resistors generate significant thermal (Johnson-Nyquist) noise, which gets amplified by the op-amp's internal noise gain. The table below maps target gains to real E24 resistor pairs, calculating the actual gain error and the thermal noise density of the feedback resistor at 25°C.

Target Gain (Av) Rf (E24) Ri (E24) Actual Gain Gain Error Rf Thermal Noise (nV/√Hz)
5 12 kΩ 3.0 kΩ 5.00 0.0% 14.1
10 91 kΩ 10 kΩ 10.10 +1.0% 38.8
50 470 kΩ 10 kΩ 48.00 -4.0% 88.2
100 1.0 MΩ 10 kΩ 101.00 +1.0% 128.7
Bench Insight: Notice the 1 MΩ feedback resistor for a gain of 100 generates nearly 129 nV/√Hz of thermal noise alone. If you are amplifying a low-level sensor signal (like a thermocouple), this noise will obliterate your signal-to-noise ratio. Keep Rf below 100 kΩ whenever possible, and use lower-value E96 resistors or multi-stage amplification for high gains.

Derivation and Assumptions: When the Math Holds Up

The standard gain equation for op amp circuits relies on the virtual short assumption. Because the open-loop gain (AOL) is massive, the op-amp drives its output to whatever voltage is necessary to make the inverting (-) and non-inverting (+) inputs equal.

For a non-inverting amplifier, Vin is applied to the (+) terminal. The voltage divider at the (-) terminal yields V- = Vout * [Ri / (Ri + Rf)]. Setting V- = Vin and solving for Vout/Vin gives Av = 1 + (Rf/Ri).

Critical Assumptions

  • Infinite AOL: The formula assumes AOL is infinite. In reality, a general-purpose LM358 has an AOL of about 100,000 V/V. This introduces a slight gain error, which becomes significant when your closed-loop gain approaches 1,000.
  • Infinite Input Impedance: Assumes no current flows into the (+) or (-) pins. Real op-amps have input bias currents (pA for FET inputs, nA for bipolar) that create voltage drops across your resistors.
  • Zero Output Impedance: Assumes the op-amp can drive any load. If you hang a 50 Ω load on an op-amp rated for 20 mA output current, the output voltage will sag, breaking the gain equation.

Rearranged Forms: Solving for Any Variable

When designing on the bench, you rarely solve for Av directly. Usually, you have a target gain and a fixed input resistor, and you need to find the feedback resistor. Here are the algebraically rearranged forms for the non-inverting topology:

  • Solve for Feedback Resistor: Rf = Ri * (Av - 1)
  • Solve for Input Resistor: Ri = Rf / (Av - 1)
  • Solve for Output Voltage: Vout = Vin * Av
  • Solve for Input Voltage: Vin = Vout / Av

Worked Examples with Unit Tracking

Let's apply the math to two real-world scenarios, tracking units at every step to prevent magnitude errors.

Problem 1: Non-Inverting Sensor Amplifier

Scenario: You have a pressure sensor outputting 15 mV at full scale. You need to amplify this to exactly 3.0 V to feed a microcontroller ADC. You have a 2.2 kΩ precision resistor for Ri. Find the required Rf and verify the output.

  1. Calculate Target Gain:
    Av = Vout / Vin
    Av = 3.0 V / 0.015 V = 200 V/V
  2. Rearrange for Rf:
    Rf = Ri * (Av - 1)
    Rf = 2,200 Ω * (200 - 1)
    Rf = 2,200 Ω * 199 = 437,800 Ω (or 437.8 kΩ)
  3. Select Real Component:
    The closest E96 (1%) resistor is 432 kΩ. Let's use 432 kΩ.
  4. Verify Actual Output:
    Actual Av = 1 + (432,000 / 2,200) = 1 + 196.36 = 197.36
    Vout = 0.015 V * 197.36 = 2.96 V

Problem 2: Inverting Amplifier with Finite Open-Loop Error

Scenario: You build an inverting amplifier with Rf = 100 kΩ and Ri = 1 kΩ using a TL072 op-amp. The datasheet specifies a typical AOL of 200 V/mV (which is 200,000 V/V). Calculate the exact real-world gain.

  1. Calculate Ideal Gain:
    Aideal = -(Rf / Ri) = -(100,000 / 1,000) = -100 V/V
  2. Apply the Real-World Gain Formula:
    The exact closed-loop gain accounting for finite AOL is:
    Acl = Aideal / [1 + (1 - Aideal) / AOL]
  3. Substitute Values:
    Acl = -100 / [1 + (1 - (-100)) / 200,000]
    Acl = -100 / [1 + 101 / 200,000]
    Acl = -100 / [1 + 0.000505]
    Acl = -100 / 1.000505 = -99.9495 V/V

Takeaway: The error is only 0.05%. For audio or general DC applications, the ideal equation is perfectly sufficient. However, if you were using an LM324 (AOL ≈ 25,000 V/V) at a gain of -500, this error would balloon to nearly 2%, which matters in precision instrumentation.

Common Unit Mistakes and Magnitude Sanity Checks

When the gain equation for op amp circuits yields bizarre results on the bench, it is almost always due to one of three specific errors.

1. The kΩ Ratio Trap

Because gain is a ratio (Rf / Ri), the units cancel out. 100 kΩ / 10 kΩ is exactly the same as 100,000 Ω / 10,000 Ω. The mistake happens when builders mix prefixes: using a 100 kΩ resistor for Rf and a 100 Ω resistor for Ri, assuming the 'k' cancels out. It doesn't. Your gain jumps from 100 to 1,000, instantly railing the output.

2. Ignoring the Supply Rails (The Magnitude Check)

A realistic closed-loop gain magnitude is between 1 and 1,000. If your math yields an Av of 15,000, you have likely swapped Rf and Ri. Furthermore, the equation does not know about physics. If Vin is 1V and Av is 20, the equation demands 20V out. If your op-amp is powered by a single 12V supply, the output will hard-clip at roughly 10.5V (for a non-rail-to-rail op-amp). Always multiply your maximum Vin by Av and verify it sits at least 1.5V below your positive supply rail.

3. Forgetting the Gain-Bandwidth Product (GBWP)

The gain equation assumes DC or low frequencies. At higher frequencies, the op-amp's internal compensation capacitor limits the gain. The GBWP is constant. If you use an LM358 (GBWP = 1 MHz) and set your resistor ratio for a gain of 1,000, your maximum usable bandwidth shrinks to 1 kHz (1,000,000 / 1,000). If you try to amplify a 10 kHz audio signal with this circuit, the actual gain will plummet far below your resistor ratio dictates. For high-gain, high-frequency applications, you must cascade two op-amps (e.g., two stages of gain = 31.6 to achieve 1,000 total) to preserve bandwidth.

For deeper dives into op-amp finite gain errors and bandwidth limits, consult the TI Precision Labs Op-Amp Series and the Analog Devices Op-Amp Learning Center. Academic foundations can be reviewed via MIT OpenCourseWare 6.101.