Differential EquationsModeling with First-Order Equations6 of 6
Modeling with First-Order Equations · 6

RC and RL Circuits

When a circuit includes a capacitor or an inductor, voltage and current don't jump to their final values the instant you flip a switch, so we use differential equations to find how they change over time tt.

1

Discharging an RC Circuit and the Time Constant

We first want to find how the charge Q(t)\unknown{Q(t)} and voltage VC(t)\unknown{V_C(t)} on an already-charged capacitor drain over time when it is connected in a simple loop with a resistor RR.

Discharging an RC Circuit and the Time Constant
RR
CC
Q0\htmlClass{lc-blue}{Q_0}
Q(t)=?\htmlClass{lc-blue}{Q(t)} = {?}
Text solution
Match the voltages around the loopWith no battery in the circuit, the capacitor's voltage VC=QC\unknown{V_C} = \frac{\unknown{Q}}{C} pushes current through the resistor, matching the resistor's voltage drop VR=I⋅RV_R = \rate{I} \cdot R:
VC=VR  ⟹  QC=I⋅R\displaystyle \begin{aligned} \unknown{V_C} &= V_R \\ \implies \frac{\unknown{Q}}{C} &= \rate{I} \cdot R \end{aligned}
Write the resistor current as the rate charge leaves the platesBecause the charge Q\unknown{Q} on the capacitor is decreasing (dQdt<0\rate{\frac{dQ}{dt}} < 0), the positive current I\rate{I} flowing out through the resistor needs a minus sign, I=−dQdt\rate{I} = -\rate{\frac{dQ}{dt}}:
QC=−dQdt⋅R  ⟹  dQdt=−1RCQ\displaystyle \begin{aligned} \frac{\unknown{Q}}{C} &= -\rate{\frac{dQ}{dt}} \cdot R \\ \implies \rate{\frac{dQ}{dt}} &= -\frac{1}{RC}\unknown{Q} \end{aligned}
Separate variables and integrate from the starting charge Q0\unknown{Q_0}Dividing Q\unknown{Q} to the left and multiplying dt\rate{dt} to the right lets us integrate from Q0\unknown{Q_0} at t=0t = 0 to Q\unknown{Q} at time tt:
∫Q0Q1Q dQ=∫0t−1RC dtln⁡(QQ0)=−tRCQ(t)=Q0e−t/RC⏟time constant τ\displaystyle \begin{aligned} \op{\int_{\unknown{Q_0}}^{\unknown{Q}}} \frac{1}{\unknown{Q}}\,\rate{dQ} &= \op{\int_0^t} -\frac{1}{RC}\,\rate{dt} \\ \ln\left(\frac{\unknown{Q}}{\unknown{Q_0}}\right) &= -\frac{t}{RC} \\ \unknown{Q(t)} &= \unknown{Q_0} e^{-t/\underbrace{RC}_{\text{time constant }\tau}} \end{aligned}

Dividing both sides by CC gives the exact same decay curve for the capacitor's voltage from its starting voltage V0=Q0C\unknown{V_0} = \frac{\unknown{Q_0}}{C}:

VC(t)\displaystyle \unknown{V_C(t)} =V0e−t/τ,τ\displaystyle = \unknown{V_0} e^{-t/\tau}, \qquad \tau =RC\displaystyle = RC

In the exponent, Ω⋅F=s\Omega \cdot \text{F} = \text{s}, so τ=RC\tau = RC measures time in seconds: at t=τt = \tau, e−1≈0.37e^{-1} \approx 0.37 of the initial charge remains (63%63\% has drained), and by t=5τt = 5\tau, e−5<0.01e^{-5} < 0.01, so less than 1%1\% is left.

RR
CC
I\htmlClass{lc-pink}{I}
Q\htmlClass{lc-mute}{Q}
t\htmlClass{lc-mute}{t}
τ\tau
5τ5\tau
Q0\htmlClass{lc-blue}{Q_0}
63%63\%
(τ, 0.37 Q0)(\tau,\ 0.37\,\htmlClass{lc-blue}{Q_0})
<0.01 Q0< 0.01\,\htmlClass{lc-blue}{Q_0}
Q(t)=Q0e−t/τ\htmlClass{lc-blue}{Q(t)} = \htmlClass{lc-blue}{Q_0}e^{-t/\tau}
2

Charging an RC Circuit

Now we put a constant battery Vb\source{V_b} into the loop with the resistor RR and an initially empty capacitor CC, and we want to find how the capacitor voltage VC(t)\unknown{V_C(t)} builds up from 0\unknown{0} toward Vb\source{V_b}.

Just like an object warming or cooling toward room temperature Tm\source{T_m} in Newton's Law of Cooling, dTdt=k(Tm−T)\rate{\frac{dT}{dt}} = k(\source{T_m} - \unknown{T}), the capacitor's voltage changes at a rate proportional to the remaining voltage gap Vb−VC\source{V_b} - \unknown{V_C} between the battery and the capacitor.

Charging an RC Circuit
RR
CC
Vb\htmlClass{lc-green}{V_b}
Vb\htmlClass{lc-green}{V_b}
00
VC\htmlClass{lc-blue}{V_C}
VC(t)=?\htmlClass{lc-blue}{V_C(t)} = {?}
Text solution
Find the leftover voltage pushing current through the resistorThe battery voltage Vb\source{V_b} splits between the resistor and the capacitor, leaving the gap Vb−VC\source{V_b} - \unknown{V_C} across the resistor:
Vb=VR+VC  ⟹  VR=Vb−VC  ⟹  I⋅R=Vb−VC\displaystyle \begin{aligned} \source{V_b} &= V_R + \unknown{V_C} \\ \implies V_R &= \source{V_b} - \unknown{V_C} \\ \implies \rate{I} \cdot R &= \source{V_b} - \unknown{V_C} \end{aligned}
Rewrite the current in terms of capacitor voltageSince Q=C⋅VC\unknown{Q} = C \cdot \unknown{V_C} and incoming current adds charge to the plates, I=dQdt=CdVCdt\rate{I} = \rate{\frac{dQ}{dt}} = C\rate{\frac{dV_C}{dt}} with a positive sign:
RCdVCdt=Vb−VC  ⟹  dVCdt=1RC(Vb−VC)\displaystyle \begin{aligned} RC\rate{\frac{dV_C}{dt}} &= \source{V_b} - \unknown{V_C} \\ \implies \rate{\frac{dV_C}{dt}} &= \frac{1}{RC}(\source{V_b} - \unknown{V_C}) \end{aligned}
Separate variables to see the voltage gap decayDividing by Vb−VC\source{V_b} - \unknown{V_C} and integrating from VC(0)=0\unknown{V_C(0)} = 0 shows that the remaining voltage gap shrinks by the same factor e−t/RCe^{-t/RC} as a discharging capacitor:
∫0VC1Vb−VC dVC=∫0t1RC dt−ln⁡(Vb−VCVb)=tRCVb−VC⏟remaining gap=Vbe−t/RCVC(t)=Vb−Vbe−t/RC=Vb(1−e−t/RC)\displaystyle \begin{aligned} \op{\int_0^{\unknown{V_C}}} \frac{1}{\source{V_b} - \unknown{V_C}}\,\rate{dV_C} &= \op{\int_0^t} \frac{1}{RC}\,\rate{dt} \\ -\ln\left(\frac{\source{V_b} - \unknown{V_C}}{\source{V_b}}\right) &= \frac{t}{RC} \\ \gap{\underbrace{\source{V_b} - \unknown{V_C}}_{\text{remaining gap}}} &= \source{V_b} e^{-t/RC} \\ \unknown{V_C(t)} &= \source{V_b} - \source{V_b} e^{-t/RC} \\ &= \source{V_b}\left(1 - e^{-t/RC}\right) \end{aligned}
3

Inductors and RL Circuits

Next, we replace the capacitor with an inductor LL in series with the resistor RR and battery Vb\source{V_b}, and we want to find how the current I(t)\unknown{I(t)} grows from 0\unknown{0} after the switch closes.

While a capacitor resists changes in voltage, an inductor is a coil whose magnetic field resists changes in current with a voltage drop VL=LdIdtV_L = L\rate{\frac{dI}{dt}}. As current builds up, the resistor's voltage drop I⋅R\unknown{I} \cdot R grows against the battery voltage Vb\source{V_b}, just like air drag kvk\unknown{v} grows against gravity mg\source{mg} for a falling skydiver in mdvdt=mg−kvm\rate{\frac{dv}{dt}} = \source{mg} - k\unknown{v}.

Inductors and RL Circuits
RR
LL
Vb\htmlClass{lc-green}{V_b}
I\htmlClass{lc-blue}{I}
I(t)=?\htmlClass{lc-blue}{I(t)} = {?}
Text solution
Split the battery voltage around the RL loopAdding the resistor drop I⋅R\unknown{I} \cdot R and the inductor drop LdIdtL\rate{\frac{dI}{dt}} gives the differential equation for I(t)\unknown{I(t)}:
Vb=VR+VL=I⋅R+LdIdt  ⟹  LdIdt=Vb−I⋅R\displaystyle \begin{aligned} \source{V_b} &= V_R + V_L \\ &= \unknown{I} \cdot R + L\rate{\frac{dI}{dt}} \\ \implies L\rate{\frac{dI}{dt}} &= \source{V_b} - \unknown{I} \cdot R \end{aligned}
Divide by RR to match the charging equationThe current rises toward the value where the resistor uses all the battery voltage (I⋅R=Vb\unknown{I} \cdot R = \source{V_b}), the terminal current ceiling:
LR⏟time constant τdIdt\displaystyle \underbrace{\frac{L}{R}}_{\text{time constant }\tau}\rate{\frac{dI}{dt}} =VbR⏟terminal currentImax⁡−I\displaystyle = \source{\underbrace{\frac{V_b}{R}}_{\substack{\text{terminal current} \\ I_{\max}}}} - \unknown{I}
Write the current curve directly from the charging solutionBecause this equation has the exact same form as the charging capacitor with Imax⁡\source{I_{\max}} in place of Vb\source{V_b} and τ=LR\tau = \frac{L}{R} in place of RCRC, and the current starts at I(0)=0\unknown{I(0)} = 0 just as VC(0)=0\unknown{V_C(0)} = 0, its solution is:
I(t)=Imax⁡(1−e−t/τ),Imax⁡=VbR,τ=LR\displaystyle \begin{aligned} \unknown{I(t)} &= \source{I_{\max}}\left(1 - e^{-t/\tau}\right), \\ \source{I_{\max}} &= \source{\frac{V_b}{R}}, \quad \tau = \frac{L}{R} \end{aligned}

At t=0+t = 0^+, when I=0\unknown{I} = 0, the starting slope dIdt=VbL\rate{\frac{dI}{dt}} = \rate{\frac{V_b}{L}} is the same for every resistance RR, while increasing RR lowers the ceiling Imax⁡=VbR\source{I_{\max}} = \source{\frac{V_b}{R}}, so the time constant τ=LR\tau = \frac{L}{R} is shorter.

More resistance doesn't change how fast the current starts climbing, it just lowers the ceiling so the current levels off sooner.
4

The Start, Target, and Time Constant Shortcut

Whenever a circuit is driven by a constant source (a steady DC battery Vb\source{V_b}, or no battery at all), we can write down any voltage or current directly from its starting value at t=0+t = 0^+ and its final target as t→∞t \to \infty without solving the integral again.

The Start, Target, and Time Constant Shortcut
Q\htmlClass{lc-mute}{Q}
t\htmlClass{lc-mute}{t}
VC\htmlClass{lc-mute}{V_C}
t\htmlClass{lc-mute}{t}
I\htmlClass{lc-mute}{I}
t\htmlClass{lc-mute}{t}
Q0\htmlClass{lc-blue}{Q_0}
Vb\htmlClass{lc-green}{V_b}
Imax⁡\htmlClass{lc-green}{I_{\max}}
Value(t)=?\htmlClass{lc-blue}{\text{Value}(t)} = {?}

Every voltage or current in a constant-source RC or RL circuit starts at its initial value and closes the gap to its fixed target at the rate e−t/τe^{-t/\tau}:

Value(t)=Target+(Start−Target)e−t/τ,τ=RC or τ=LR\displaystyle \boxed{\begin{aligned} \unknown{\text{Value}(t)} &= \source{\text{Target}} \\ &+ (\unknown{\text{Start}} - \source{\text{Target}})e^{-t/\tau}, \\ \tau &= RC \text{ or } \tau = \frac{L}{R} \end{aligned}}

To read Start\unknown{\text{Start}} at t=0+t = 0^+ and Target\source{\text{Target}} as t→∞t \to \infty directly from the circuit diagram, use how the capacitor and inductor behave at t=0+t = 0^+ and as t→∞t \to \infty:

Start (t=0+)\htmlClass{lc-blue}{\text{Start}}\ (t = 0^+)
Target (t→∞)\htmlClass{lc-green}{\text{Target}}\ (t \to \infty)
CC
VC cannot jump:keeps VC(0−)(short wireif empty, VC=0)\begin{array}{c}\htmlClass{lc-blue}{V_C}\text{ cannot jump:}\\ \text{keeps } \htmlClass{lc-blue}{V_C(0^-)}\\ \text{(short wire}\\ \text{if empty, } \htmlClass{lc-blue}{V_C} = 0\text{)}\end{array}
CC
open circuit(I=0)\begin{array}{c}\text{open circuit}\\ (\htmlClass{lc-pink}{I} = 0)\end{array}
LL
IL cannot jump:keeps IL(0−)(open breakif IL=0)\begin{array}{c}\htmlClass{lc-blue}{I_L}\text{ cannot jump:}\\ \text{keeps } \htmlClass{lc-blue}{I_L(0^-)}\\ \text{(open break}\\ \text{if } \htmlClass{lc-blue}{I_L} = 0\text{)}\end{array}
LL
plain wire(VL=0)\begin{array}{c}\text{plain wire}\\ (V_L = 0)\end{array}

Now let's use Start, Target, and τ\tau on two cases: finding the resistor current while a 10 V\source{10}\text{ V} battery charges an empty capacitor, and finding the voltage when the capacitor starts with 3 V\unknown{3}\text{ V} already on its plates.

Text solution
Find the charging current I(t)\rate{I(t)} for an initially empty capacitor on a 10 V\source{10}\text{ V} batteryAt t=0+t = 0^+, the empty capacitor has VC(0+)=0 V\unknown{V_C(0^+)} = 0\text{ V} so all 10 V\source{10}\text{ V} sits across the resistor, while as t→∞t \to \infty the full capacitor blocks current completely:
Start=I(0+)=10R,Target=I(∞)=0I(t)=0+(10R−0)e−t/RC=10Re−t/RC\displaystyle \begin{aligned} \unknown{\text{Start}} &= \rate{I(0^+)} = \frac{10}{R}, \\ \source{\text{Target}} &= \rate{I(\infty)} = 0 \\ \rate{I(t)} &= \source{0} + \left(\rate{\frac{10}{R}} - \source{0}\right)e^{-t/RC} \\ &= \frac{10}{R}e^{-t/RC} \end{aligned}
Find the voltage VC(t)\unknown{V_C(t)} when a capacitor starting at 3 V\unknown{3}\text{ V} is connected to a 10 V\source{10}\text{ V} batteryThe capacitor voltage stays at 3 V\unknown{3}\text{ V} at the instant t=0+t = 0^+ and approaches the 10 V\source{10}\text{ V} battery as t→∞t \to \infty:
Start=3 V,Target=10 VVC(t)=10+(3−10)e−t/RC=10−7e−t/RC\displaystyle \begin{aligned} \unknown{\text{Start}} &= 3\text{ V}, \\ \source{\text{Target}} &= 10\text{ V} \\ \unknown{V_C(t)} &= \source{10} + (\unknown{3} - \source{10})e^{-t/RC} \\ &= \source{10} \gap{{}- 7}e^{-t/RC} \end{aligned}

So the current decays to zero even while the capacitor charges, and a partially charged capacitor closes the remaining 7 V\gap{7}\text{ V} gap along the same exponential curve.

Whether VC(0)\unknown{V_C(0)} starts below the battery voltage (charging up) or above it (draining back into the battery and reversing the resistor current), Value(t)=Target+(Start−Target)e−t/τ\unknown{\text{Value}(t)} = \source{\text{Target}} + (\unknown{\text{Start}} - \source{\text{Target}})e^{-t/\tau} always closes 63%63\% of the initial gap Start−Target\unknown{\text{Start}} - \source{\text{Target}} in one time constant τ\tau.

No matter where the voltage starts, the capacitor always closes 63% of the gap to the battery in one time constant.
5

Time-Varying Sources: Transient and Steady-State Response

When the constant battery is replaced by a time-varying voltage source Vs(t)\source{V_s(t)}, such as an alternating source Vs(t)=V0cos⁡(ωt)\source{V_s(t)} = \source{V_0\cos(\omega t)}, the target keeps moving. The Start-Target shortcut and separation of variables no longer work, so we solve the full differential equation to find how the circuit responds.

Instead, we put the loop equation in standard linear form and use an integrating factor.

Time-Varying Sources: Transient and Steady-State Response
RR
CC
Vs(t)=V0cos⁡(ωt)\htmlClass{lc-green}{V_s(t)} = \htmlClass{lc-green}{V_0\cos(\omega t)}
VC\htmlClass{lc-mute}{V_C}
t\htmlClass{lc-mute}{t}
V0\htmlClass{lc-green}{V_0}
VC(t)=?\htmlClass{lc-blue}{V_C(t)} = {?}
Text solution
Move VC\unknown{V_C} (or I\unknown{I}) to the left for standard linear formBecause Vs(t)\source{V_s(t)} changes with time tt, we cannot divide by Vs(t)−VC\source{V_s(t)} - \unknown{V_C} to separate variables, so we group VC\unknown{V_C} on the left with τ=RC\tau = RC (or group I\unknown{I} on the left with τ=LR\tau = \frac{L}{R} for an RL circuit):
dVCdt+1τVC=1τVs(t)(or dIdt+1τI=1LVs(t) for RL)\displaystyle \begin{aligned} \rate{\frac{dV_C}{dt}} + \frac{1}{\tau}\unknown{V_C} &= \frac{1}{\tau}\source{V_s(t)} \\ \Big(\text{or }\rate{\frac{dI}{dt}} + \frac{1}{\tau}\unknown{I} &= \frac{1}{L}\source{V_s(t)}\text{ for RL}\Big) \end{aligned}
Multiply by the integrating factor μ(t)=e∫(1/τ) dt=et/τ\op{\mu(t)} = \op{e^{\int (1/\tau)\,dt}} = \op{e^{t/\tau}}Multiplying every term by et/τ\op{e^{t/\tau}} turns the left side into the derivative of a product:
et/τdVCdt+1τet/τVC=1τet/τVs(t)ddt[VC⋅et/τ]=1τet/τVs(t)\displaystyle \begin{aligned} \op{e^{t/\tau}}\rate{\frac{dV_C}{dt}} + \frac{1}{\tau}\op{e^{t/\tau}}\unknown{V_C} &= \frac{1}{\tau}\op{e^{t/\tau}}\source{V_s(t)} \\ \rate{\frac{d}{dt}}\left[\unknown{V_C} \cdot e^{t/\tau}\right] &= \frac{1}{\tau}\op{e^{t/\tau}}\source{V_s(t)} \end{aligned}
Integrate both sides and divide by et/τe^{t/\tau}Integrating adds the constant KK, and multiplying through by e−t/τe^{-t/\tau} separates the Ke−t/τ\gap{K e^{-t/\tau}} term from the source integral:
VC⋅et/τ=∫1τet/τVs(t) dt+KVC(t)=Ke−t/τ⏟dies out+e−t/τ∫1τet/τVs(t) dt⏟driven by the source\displaystyle \begin{aligned} \unknown{V_C} \cdot e^{t/\tau} &= \op{\int} \frac{1}{\tau}e^{t/\tau}\source{V_s(t)}\,dt + K \\ \unknown{V_C(t)} &= \gap{\underbrace{K e^{-t/\tau}}_{\text{dies out}}} \\ &\quad + \source{\underbrace{e^{-t/\tau}\int \frac{1}{\tau}e^{t/\tau}V_s(t)\,dt}_{\text{driven by the source}}} \end{aligned}
Evaluate for the alternating source Vs(t)=V0cos⁡(ωt)\source{V_s(t)} = \source{V_0\cos(\omega t)}Integrating et/τcos⁡(ωt)e^{t/\tau}\cos(\omega t) gives et/τe^{t/\tau} times a combination of cos⁡(ωt)\cos(\omega t) and sin⁡(ωt)\sin(\omega t), so e−t/τ⋅et/τ=1e^{-t/\tau} \cdot e^{t/\tau} = 1 cancels out on the right:
VC(t)=Ke−t/τ⏟transient+Acos⁡(ωt)+Bsin⁡(ωt)⏟steady-state,A=V01+ω2τ2,B=ωτA\displaystyle \boxed{\begin{aligned} \unknown{V_C(t)} &= \gap{\underbrace{K e^{-t/\tau}}_{\text{transient}}} \\ &+ \source{\underbrace{A\cos(\omega t) + B\sin(\omega t)}_{\text{steady-state}}}, \\ A &= \frac{\source{V_0}}{1 + \omega^2\tau^2}, \quad B = \omega\tau A \end{aligned}}

So the response splits into a transient part Ke−t/τ\gap{K e^{-t/\tau}} set by the starting state that fades below 1%1\% after 5τ5\tau, and a steady-state oscillation at the source frequency ω\omega that continues forever.

Always write down the full solution before plugging in t=0t = 0 to find KK: because cos⁡(0)=1\cos(0) = 1, the steady-state part already contributes A\source{A} at t=0t = 0, giving VC(0)=K+A\unknown{V_C(0)} = \gap{K} + \source{A} rather than K=VC(0)K = \unknown{V_C(0)}. And if the source is another function of time (such as a decaying exponential Vs(t)=10e−t\source{V_s(t)} = \source{10e^{-t}}), compute the integral directly rather than using the cosine formulas for AA and BB.

Changing the starting voltage VC(0)\unknown{V_C(0)} changes only the initial transient term Ke−t/τ\gap{K e^{-t/\tau}}, so every voltage curve VC(t)\unknown{V_C(t)} settles into the exact same steady-state wave Acos⁡(ωt)+Bsin⁡(ωt)\source{A\cos(\omega t) + B\sin(\omega t)} within 5τ5\tau.

Every starting voltage on the capacitor produces a transient that shrinks below 1% of its starting size within five time constants, leaving the exact same steady-state wave.

Key concepts

Every RC or RL problem starts by matching the voltages around the loop (VR=I⋅RV_R = I \cdot R, VC=QC\unknown{V_C} = \frac{\unknown{Q}}{C}, and VL=LdIdtV_L = L\rate{\frac{dI}{dt}}), using I=CdVCdt\rate{I} = C\rate{\frac{dV_C}{dt}} when a source pushes current into a capacitor or I=−dQdt\rate{I} = -\rate{\frac{dQ}{dt}} when a capacitor drains on its own (Q\unknown{Q} is decreasing, giving dQdt=−1RCQ\rate{\frac{dQ}{dt}} = -\frac{1}{RC}\unknown{Q}). What you do next depends on one question: is the voltage source constant, or does it change with time tt?

Constant source (DC battery Vb\source{V_b}, or 0 V\source{0}\text{ V} when discharging): shrink the gap to a fixed target

Do not set up an integrating factor or integrate again when the source is constant. Because the target is fixed, every voltage and current follows the shrinking-gap shortcut:

Value(t)=Target+(Start−Target)e−t/τ,τ=RC or τ=LR\displaystyle \begin{aligned} \unknown{\text{Value}(t)} &= \source{\text{Target}} \\ &+ (\unknown{\text{Start}} - \source{\text{Target}})e^{-t/\tau}, \\ \tau &= RC \text{ or } \tau = \frac{L}{R} \end{aligned}

  • At t=0+t = 0^+ (Start\unknown{\text{Start}}): Capacitor voltage VC\unknown{V_C} and inductor current IL\unknown{I_L} cannot jump the instant the switch flips (an empty capacitor acts like a short wire with VC=0\unknown{V_C} = 0; an inductor with no current acts like an open break with IL=0\unknown{I_L} = 0).
  • As t→∞t \to \infty (Target\source{\text{Target}}): After 5τ5\tau (less than 1%1\% of the gap left), a full capacitor blocks current like an open circuit (I=0\rate{I} = 0), and an inductor with steady current acts like a plain wire (VL=0V_L = 0, so Imax⁡=VbR\source{I_{\max}} = \source{\frac{V_b}{R}}).
  • Example: A capacitor at 3 V\unknown{3}\text{ V} connected to a 10 V\source{10}\text{ V} battery has Start=3 V\unknown{\text{Start}} = 3\text{ V} and Target=10 V\source{\text{Target}} = 10\text{ V}, giving VC(t)=10+(3−10)e−t/RC=10−7e−t/RC V\unknown{V_C(t)} = \source{10} + (\unknown{3} - \source{10})e^{-t/RC} = \source{10} \gap{{}- 7}e^{-t/RC}\text{ V} right away.
Time-varying source Vs(t)\source{V_s(t)}: move VC\unknown{V_C} or I\unknown{I} to the left and multiply by et/τ\op{e^{t/\tau}}

Do not use the Start-Target shortcut or try to separate variables when Vs(t)\source{V_s(t)} depends on tt, because there is no fixed target. Write the equation in standard linear form:

dVCdt+1τVC=1τVs(t)ordIdt+1τI=1LVs(t)\displaystyle \begin{aligned} \rate{\frac{dV_C}{dt}} + \frac{1}{\tau}\unknown{V_C} &= \frac{1}{\tau}\source{V_s(t)} \\ \text{or} \quad \rate{\frac{dI}{dt}} + \frac{1}{\tau}\unknown{I} &= \frac{1}{L}\source{V_s(t)} \end{aligned}
Multiplying by the integrating factor μ(t)=et/τ\op{\mu(t)} = \op{e^{t/\tau}} turns the left side into ddt[VC⋅et/τ]\rate{\frac{d}{dt}}\left[\unknown{V_C} \cdot e^{t/\tau}\right] (or ddt[I⋅et/τ]\rate{\frac{d}{dt}}\left[\unknown{I} \cdot e^{t/\tau}\right]). Integrating and dividing by et/τe^{t/\tau} splits the answer into a transient part Ke−t/τ\gap{K e^{-t/\tau}} set by the starting value that is below 1%1\% of its starting size after 5τ5\tau, plus a steady-state part driven by the source.

  • Example: With Vs(t)=10cos⁡(4t) V\source{V_s(t)} = \source{10\cos(4t)}\text{ V} and τ=0.5 s\tau = 0.5\text{ s} (so ωτ=2\omega\tau = 2), A=101+22=2A = \frac{\source{10}}{1 + 2^2} = 2 and B=2(2)=4B = 2(2) = 4, giving VC(t)=Ke−2t+2cos⁡(4t)+4sin⁡(4t) V\unknown{V_C(t)} = \gap{K e^{-2t}} + \source{2\cos(4t) + 4\sin(4t)}\text{ V}, where KK is found by plugging t=0t = 0 into the full equation.
6

Practice

1

A capacitor with capacitance C=2 mFC = 2\text{ mF} holds an initial charge of Q0=6 mC\unknown{Q_0} = 6\text{ mC} and discharges through a resistor of R=500 ΩR = 500\text{ }\Omega starting at t=0t = 0. Write the differential equation for Q(t)\unknown{Q(t)}, find Q(t)\unknown{Q(t)} and the current I(t)\rate{I(t)}, and find the time when 10%10\% of the initial charge remains.

As the capacitor drains, is Q(t)\unknown{Q(t)} increasing or decreasing, and what sign does that require in front of dQdt\rate{\frac{dQ}{dt}} when you write the positive resistor current I\rate{I}?

First find the time constant from R=500 ΩR = 500\text{ }\Omega and C=2 mF=2×10−3 FC = 2\text{ mF} = 2 \times 10^{-3}\text{ F}:
τ\displaystyle \tau =RC\displaystyle = RC =500⋅(2×10−3)\displaystyle = 500 \cdot (2 \times 10^{-3}) =1 s\displaystyle = 1\text{ s}
Match the capacitor and resistor voltages around the loop with I=−dQdt\rate{I} = -\rate{\frac{dQ}{dt}} (leaving off the minus sign gives dQdt=+Q\frac{dQ}{dt} = +Q, which would make the charge grow forever, or gives a negative current −6e−t mA-6e^{-t}\text{ mA}):
QC=I⋅RQC=−dQdt⋅RdQdt=−1RCQ=−Q\displaystyle \begin{aligned} \frac{\unknown{Q}}{C} &= \rate{I} \cdot R \\ \frac{\unknown{Q}}{C} &= -\rate{\frac{dQ}{dt}} \cdot R \\ \rate{\frac{dQ}{dt}} &= -\frac{1}{RC}\unknown{Q} = -\unknown{Q} \end{aligned}
With initial charge Q0=6 mC\unknown{Q_0} = 6\text{ mC} and τ=1 s\tau = 1\text{ s}, the charge and current decay exponentially:
Q(t)=Q0e−t/τ=6e−t mCI(t)=−dQdt=6e−t mA\displaystyle \begin{aligned} \unknown{Q(t)} &= \unknown{Q_0} e^{-t/\tau} = \unknown{6}e^{-t}\text{ mC} \\ \rate{I(t)} &= -\rate{\frac{dQ}{dt}} = 6e^{-t}\text{ mA} \end{aligned}
Set Q(t)=0.10 Q0\unknown{Q(t)} = 0.10\,\unknown{Q_0} to find when 10%10\% of the initial charge remains (setting Q(t)Q0=0.90\frac{Q(t)}{Q_0} = 0.90 finds when 10%10\% is lost, giving t=−ln⁡(0.90)≈0.105 st = -\ln(0.90) \approx 0.105\text{ s}):
e−t=0.10=110−t=−ln⁡(10)t=ln⁡(10)≈2.30 s\displaystyle \begin{aligned} e^{-t} &= 0.10 = \frac{1}{10} \\ -t &= -\ln(10) \\ t &= \ln(10) \approx 2.30\text{ s} \end{aligned}
2

An inductor with L=4 HL = 4\text{ H} and a resistor with R=8 ΩR = 8\text{ }\Omega are connected in series at t=0t = 0 to a constant 24 V24\text{ V} battery, with zero initial current. Write the differential equation for I(t)\unknown{I(t)}, and find the time constant τ\tau, the terminal current Imax⁡\source{I_{\max}}, the current I(t)\unknown{I(t)}, and the initial rate of change dIdt\rate{\frac{dI}{dt}} at t=0+t = 0^+.

Around the loop, the 24 V\source{24}\text{ V} battery splits between I⋅R\unknown{I} \cdot R and LdIdtL\rate{\frac{dI}{dt}}. At t=0+t = 0^+, how much current flows through the resistor, and as t→∞t \to \infty, what happens to dIdt\rate{\frac{dI}{dt}}?

Splitting the 24 V\source{24}\text{ V} battery between the 8 Ω8\text{ }\Omega resistor and the 4 H4\text{ H} inductor gives the differential equation:
24=8I+4dIdt  ⟹  4dIdt=24−8I\displaystyle \begin{aligned} \source{24} &= 8\unknown{I} + 4\rate{\frac{dI}{dt}} \\ \implies 4\rate{\frac{dI}{dt}} &= \source{24} - 8\unknown{I} \end{aligned}
Find the time constant τ=LR\tau = \frac{L}{R} and the terminal current ceiling Imax⁡=VbR\source{I_{\max}} = \source{\frac{V_b}{R}} (flipping the fraction to RL=2\frac{R}{L} = 2 gives the wrong answer I(t)=3(1−e−0.5t) AI(t) = 3(1 - e^{-0.5t})\text{ A}, and multiplying R⋅L=32R \cdot L = 32 gives 3(1−e−t/32) A3(1 - e^{-t/32})\text{ A}):
τ=LR=48=0.5 s,Imax⁡=VbR=248=3 A\displaystyle \begin{aligned} \tau &= \frac{L}{R} = \frac{4}{8} = 0.5\text{ s}, \\ \source{I_{\max}} &= \source{\frac{V_b}{R}} = \frac{\source{24}}{8} = 3\text{ A} \end{aligned}
Since the current rises from I(0)=0 A\unknown{I(0)} = 0\text{ A} toward Imax⁡=3 A\source{I_{\max}} = 3\text{ A} with 1τ=2 s−1\frac{1}{\tau} = 2\text{ s}^{-1}:
I(t)\displaystyle \unknown{I(t)} =Imax⁡(1−e−t/τ)\displaystyle = \source{I_{\max}}\left(1 - e^{-t/\tau}\right) =3(1−e−2t) A\displaystyle = \source{3}\left(1 - e^{-2t}\right)\text{ A}
At t=0+t = 0^+, the inductor current is still I(0+)=0 A\unknown{I(0^+)} = 0\text{ A}, so all 24 V\source{24}\text{ V} sits across the inductor (dividing 24 V24\text{ V} by R=8 ΩR = 8\text{ }\Omega instead of L=4 HL = 4\text{ H} gives 3 A/s3\text{ A/s}):
4dIdt=24−8(0)  ⟹  dIdt=244=6 A/s\displaystyle \begin{aligned} 4\rate{\frac{dI}{dt}} &= \source{24} - 8(\unknown{0}) \\ \implies \rate{\frac{dI}{dt}} &= \frac{\source{24}}{4} = 6\text{ A/s} \end{aligned}
3

A 0.1 F0.1\text{ F} capacitor already charged to 3 V3\text{ V} is connected at t=0t = 0 in series with a 20 Ω20\text{ }\Omega resistor and a 15 V15\text{ V} battery. Using Start, Target, and the time constant, find the capacitor voltage VC(t)\unknown{V_C(t)} and the current I(t)\rate{I(t)} for t>0t > 0.

The capacitor stays at 3 V\unknown{3}\text{ V} at the instant t=0+t = 0^+. How much of the battery's 15 V\source{15}\text{ V} is left across the 20 Ω20\text{ }\Omega resistor at that first instant, and how much current flows once the capacitor is full?

First compute the time constant:
τ\displaystyle \tau =RC\displaystyle = RC =20⋅0.1\displaystyle = 20 \cdot 0.1 =2 s\displaystyle = 2\text{ s}
For the capacitor voltage VC(t)\unknown{V_C(t)}, Start=3 V\unknown{\text{Start}} = 3\text{ V} at t=0+t = 0^+ and Target=15 V\source{\text{Target}} = 15\text{ V} as t→∞t \to \infty (treating the capacitor as initially empty gives 15−15e−t/2 V15 - 15e^{-t/2}\text{ V}, and reversing Start−Target\text{Start} - \text{Target} gives 15+12e−t/2 V15 + 12e^{-t/2}\text{ V}):
VC(t)=Target+(Start−Target)e−t/τ=15+(3−15)e−t/2=15−12e−t/2 V\displaystyle \begin{aligned} \unknown{V_C(t)} &= \source{\text{Target}} + (\unknown{\text{Start}} - \source{\text{Target}})e^{-t/\tau} \\ &= \source{15} + (\unknown{3} - \source{15})e^{-t/2} \\ &= \source{15} \gap{{}- 12}e^{-t/2}\text{ V} \end{aligned}
For the current I(t)\rate{I(t)}, at t=0+t = 0^+ the resistor has the remaining voltage gap 15−3=12 V\source{15} - \unknown{3} = \gap{12}\text{ V} across it (using the full 15 V15\text{ V} battery voltage ignores the 3 V3\text{ V} already on the capacitor and gives 1520e−t/2=0.75e−t/2 A\frac{15}{20}e^{-t/2} = 0.75e^{-t/2}\text{ A}), and as t→∞t \to \infty the full capacitor blocks current so Target=0 A\source{\text{Target}} = 0\text{ A}:
Start=I(0+)=15−320=1220=0.6 A,Target=I(∞)=0 AI(t)=0+(0.6−0)e−t/2=0.6e−t/2 A\displaystyle \begin{aligned} \unknown{\text{Start}} &= \rate{I(0^+)} = \frac{\source{15} - \unknown{3}}{20} = \frac{\gap{12}}{20} = 0.6\text{ A}, \\ \source{\text{Target}} &= \rate{I(\infty)} = 0\text{ A} \\ \rate{I(t)} &= \source{0} + (\rate{0.6} - \source{0})e^{-t/2} \\ &= 0.6e^{-t/2}\text{ A} \end{aligned}
4

An RL circuit with L=2 HL = 2\text{ H}, R=6 ΩR = 6\text{ }\Omega, and initial current I(0)=0 A\unknown{I(0)} = 0\text{ A} is driven by a decaying voltage source Vs(t)=10e−t V\source{V_s(t)} = 10e^{-t}\text{ V}. Write the differential equation in standard linear form and use an integrating factor to solve for I(t)\unknown{I(t)}.

After writing 2dIdt+6I=10e−t2\rate{\frac{dI}{dt}} + 6\unknown{I} = \source{10e^{-t}}, divide every term by L=2L = 2 before finding the integrating factor μ(t)\op{\mu(t)}. What happens to the exponents on the right side when you multiply through by μ(t)\op{\mu(t)}?

Write the loop equation and divide every term by L=2L = 2 to put it in standard linear form (forgetting to divide by 22 first uses R=6R = 6 to give the wrong integrating factor e6te^{6t}, or leaves 10e−t10e^{-t} on the right):
2dIdt+6I=10e−t  ⟹  dIdt+3I=5e−t\displaystyle \begin{aligned} 2\rate{\frac{dI}{dt}} + 6\unknown{I} &= \source{10e^{-t}} \\ \implies \rate{\frac{dI}{dt}} + 3\unknown{I} &= \source{5e^{-t}} \end{aligned}
Multiply through by the integrating factor μ(t)=e∫3 dt=e3t\op{\mu(t)} = \op{e^{\int 3\,dt}} = \op{e^{3t}} and write the left side as the derivative of a product:
e3tdIdt+3e3tI=5e3te−t=5e2tddt[I⋅e3t]=5e2t\displaystyle \begin{aligned} \op{e^{3t}}\rate{\frac{dI}{dt}} + 3\op{e^{3t}}\unknown{I} &= \source{5}\op{e^{3t}}\source{e^{-t}} = 5e^{2t} \\ \rate{\frac{d}{dt}}\left[\unknown{I} \cdot e^{3t}\right] &= 5e^{2t} \end{aligned}
Integrate both sides with respect to tt and divide by e3te^{3t} (forgetting to divide by the 22 in the exponent when integrating 5e2t5e^{2t} gives 5e−t5e^{-t} instead of 2.5e−t2.5e^{-t}):
I⋅e3t=∫5e2t dt=2.5e2t+KI(t)=Ke−3t+2.5e−t\displaystyle \begin{aligned} \unknown{I} \cdot e^{3t} &= \op{\int} 5e^{2t}\,dt = 2.5e^{2t} + K \\ \unknown{I(t)} &= \gap{K e^{-3t}} + \source{2.5e^{-t}} \end{aligned}
Plug in I(0)=0\unknown{I(0)} = 0 to solve for KK (assuming I(0)=0I(0) = 0 means K=0K = 0 drops the transient term and leaves the wrong answer 2.5e−t A2.5e^{-t}\text{ A}):
0=Ke0+2.5e0  ⟹  K=−2.5I(t)=2.5(e−t−e−3t) A\displaystyle \begin{aligned} \unknown{0} &= \gap{K e^{0}} + \source{2.5e^{0}} \implies K = -2.5 \\ \unknown{I(t)} &= 2.5\left(e^{-t} - e^{-3t}\right)\text{ A} \end{aligned}
5

An RC circuit with time constant τ=RC=0.5 s\tau = RC = 0.5\text{ s} and initial capacitor voltage VC(0)=8 V\unknown{V_C(0)} = 8\text{ V} is driven for t≥0t \ge 0 by an AC source Vs(t)=10cos⁡(4t) V\source{V_s(t)} = 10\cos(4t)\text{ V}. Find VC(t)\unknown{V_C(t)}, identify its transient and steady-state parts, and state how long it takes for the transient part to shrink below 1%1\% of its starting value.

Find the steady-state amplitudes AA and BB using ωτ\omega\tau first. When you plug t=0t = 0 into the total voltage VC(t)\unknown{V_C(t)} to find KK, what does the cosine term equal at t=0t = 0?

From Vs(t)=10cos⁡(4t) V\source{V_s(t)} = \source{10\cos(4t)}\text{ V} and τ=0.5 s\tau = 0.5\text{ s}, we have V0=10 V\source{V_0} = 10\text{ V}, ω=4 rad/s\omega = 4\text{ rad/s}, and ωτ=4(0.5)=2\omega\tau = 4(0.5) = 2, which gives the steady-state amplitudes:
A=V01+ω2τ2=101+22=2 V,B=ωτA=2(2)=4 V\displaystyle \begin{aligned} A &= \frac{\source{V_0}}{1 + \omega^2\tau^2} = \frac{\source{10}}{1 + 2^2} = 2\text{ V}, \\ B &= \omega\tau A = 2(2) = 4\text{ V} \end{aligned}
With 1τ=2 s−1\frac{1}{\tau} = 2\text{ s}^{-1}, the general solution is:
VC(t)\displaystyle \unknown{V_C(t)} =Ke−2t+2cos⁡(4t)+4sin⁡(4t)\displaystyle = \gap{K e^{-2t}} + \source{2\cos(4t) + 4\sin(4t)}
Plug in t=0t = 0 and VC(0)=8 V\unknown{V_C(0)} = 8\text{ V} to find KK (setting K=VC(0)=8 VK = V_C(0) = 8\text{ V} directly forgets that 2cos⁡(0)=2 V2\cos(0) = 2\text{ V} is already present at t=0t = 0, giving 8e−2t+2cos⁡(4t)+4sin⁡(4t) V8e^{-2t} + 2\cos(4t) + 4\sin(4t)\text{ V}):
8=Ke0+2cos⁡(0)+4sin⁡(0)=K+2  ⟹  K=6 VVC(t)=6e−2t+2cos⁡(4t)+4sin⁡(4t) V\displaystyle \begin{aligned} \unknown{8} &= \gap{K e^{0}} + \source{2\cos(0) + 4\sin(0)} \\ &= \gap{K} + \source{2} \implies K = 6\text{ V} \\ \unknown{V_C(t)} &= \gap{6e^{-2t}} + \source{2\cos(4t) + 4\sin(4t)}\text{ V} \end{aligned}
Transient part6e−2t V\gap{6e^{-2t}}\text{ V}
Steady-state part2cos⁡(4t)+4sin⁡(4t) V\source{2\cos(4t) + 4\sin(4t)}\text{ V}
Time for the transient part to shrink below 1%1\%within 5τ=2.5 s5\tau = 2.5\text{ s} (specifically when e−2t=0.01e^{-2t} = 0.01, at t=ln⁡(100)2≈2.30 st = \frac{\ln(100)}{2} \approx 2.30\text{ s}).