Sub topic 3
From KVL to a First-Order Differential Equation
This chapter assumes you know Ohm's law, KVL and KCL, the capacitor and inductor relations i = C dv/dt and v = L di/dt, and how to separate variables in a simple differential equation. Here you turn a circuit with one storage element into one equation. The next chapters solve it.
The recipe
Every circuit in this tutorial has one capacitor or one inductor, plus resistors and sources. The same four steps give the equation each time.
- Pick the unknown. Use the capacitor voltage vC or the inductor current iL, because these are the quantities that cannot jump.
- Write KVL (or KCL) around the circuit.
- Replace each element's voltage or current with its i-v relation.
- Rearrange until the derivative stands alone on one side.
The series RC circuit
Take a source V_s in series with a resistor R and a capacitor C. Let i be the loop current. KVL gives:
Vs = R i + vC
The capacitor current is i = C dv_C/dt. Substitute it:
Vs = RC dvC/dt + v_C
Divide by RC:
dvC/dt + vC/(RC) = V_s/(RC)
The product RC has units of seconds. Call it τ (tau). The equation becomes:
dvC/dt + vC/τ = V_s/τ
The series RL circuit
Now replace the capacitor with an inductor L. KVL gives:
V_s = R i + L di/dt
Divide by L:
di/dt + (R/L) i = V_s/L
Here τ = L/R, which also has units of seconds, so:
di/dt + i/τ = V_s/L
Both circuits share one form
Writing x(t) for the unknown (vC or iL), both equations fit this pattern:
dx/dt + x/τ = f
The constant f is the forcing term. For the RC circuit f = Vs/τ. For the RL circuit f = Vs/L. When the source is zero, f = 0 and you have the natural response. When the source is a constant after a switch closes, you have the step response.
Checking the equation with a number
A quick check catches most algebra slips. Take R = 10 kΩ, C = 100 nF, Vs = 5 V. Then τ = 10,000 × 100×10⁻⁹ = 1 ms. At the instant the source is applied, vC = 0, so the equation gives:
dvC/dt = (Vs − v_C)/τ = 5 / 0.001 = 5000 V/s
This is the initial slope. It matches the physical picture: the full 5 V appears across R, so i = 0.5 mA, and dv_C/dt = i/C = 0.5×10⁻³ / 100×10⁻⁹ = 5000 V/s. Both routes agree.
R = 10e3
C = 100e-9
Vs = 5.0
tau = R * C
v_c = 0.0
slope_from_equation = (Vs - v_c) / tau
slope_from_current = ((Vs - v_c) / R) / C
print(f"tau = {tau * 1000:.1f} ms")
print(f"From the equation: {slope_from_equation:.0f} V/s")
print(f"From i/C: {slope_from_current:.0f} V/s")Common errors
- Forgetting to divide by RC or L, which leaves the derivative with a coefficient and hides τ.
- Mixing signs when the capacitor's reference direction is opposite to the current's. Use the passive sign convention: current enters the positive terminal.
- Using τ = RC for an RL circuit, or τ = L/R for an RC circuit.
Exercise
A series RL circuit has V_s = 12 V, R = 100 Ω, and L = 10 mH. Write the differential equation for i, find τ, and give di/dt at the instant the source is applied with i = 0.
Show answer
KVL gives Vs = R i + L di/dt, so di/dt + (R/L) i = Vs/L. With R/L = 10,000 s⁻¹, τ = L/R = 100 µs. At i = 0, di/dt = V_s/L = 12 / 0.010 = 1200 A/s.