---
title: i = C dv/dt and v = L di/dt
heading: Capacitors respond to how fast voltage changes
eyebrow: A5 · Lesson 19 · Capacitors and inductors
xp: 40
---

::: hook
Connect a capacitor across a steady 5 V and, once it has charged, no current flows at all. Connect it across a voltage that's changing and current flows, the more the faster it changes. A capacitor doesn't respond to voltage. It responds to the *rate of change* of voltage, which makes it the first component that does calculus for you.

::: play
- The yellow trace is the voltage across a capacitor; the blue trace is the current through it, $i = C\,dv/dt$, in mA.
- With the triangle wave (shape 1), the voltage climbs and falls at steady rates. What does the current do?
- Switch to the sine (shape 0). Where is the current largest: at the voltage's peaks, or where it crosses zero?
- Double the frequency, then double C. What happens to the current each time?
:::
:::

```sim plot
view: graph
x: t = 0..20m s
y: y = -8..8
slider: s = 0..1 step 1 = 1
slider: f = 50..200 step 10 = 100 Hz
slider: C = 0.1..2 step 0.1 = 1
plot: (1 - s)*4*sin(2*pi*f*t) + s*(8/pi)*asin(sin(2*pi*f*t)) | samples: 2000 | label: v (V)
plot: 1000*C*1e-6*((1 - s)*4*2*pi*f*cos(2*pi*f*t) + s*16*f*sign(cos(2*pi*f*t))) | samples: 2000 | color: ch2 | label: i (mA)
readout: shape = s
readout: C in µF = C
readout: peak current in mA = 1000*C*1e-6*((1 - s)*4*2*pi*f + s*16*f)
```

::: predict
## The voltage across a capacitor is a triangle wave: steady climbs and steady falls. What shape is the current?

- [ ] Also a triangle
- [x] A square wave: constant while the voltage climbs, the opposite constant while it falls
- [ ] A sine wave
- [ ] Zero

::: reveal
A square wave. On a straight climb $dv/dt$ is constant, so the current is constant; on the fall it's the same size but negative. The current jumps at the corners, where the slope changes suddenly. With a sine instead, the current is a cosine: largest where the voltage crosses zero (steepest) and zero at the peaks (flat).
:::
:::

::: nameit
## The two component laws

A capacitor $C$ stores charge $q = Cv$. Current is the rate at which charge arrives, so

$$i = C\frac{dv}{dt}$$

An inductor $L$ is the mirror image: the voltage across it is set by how fast its current changes,

$$v = L\frac{di}{dt}$$

What follows straight from those two lines:

- **Steady DC:** if $v$ is constant, $dv/dt = 0$, so a capacitor carries no current once it has charged. If $i$ is constant, an inductor has no voltage across it. That's why, in a circuit that has settled, capacitors act like open circuits and inductors like wires.
- **No jumps:** a sudden step in a capacitor's voltage would need an infinite $dv/dt$, so infinite current. In real circuits a capacitor's voltage never jumps, and neither does an inductor's current. Interrupt an inductor's current suddenly, by opening a switch, and $L\,di/dt$ produces a large voltage spike: the reason relay coils get a diode across them.
- **Sinusoids:** with $v = V\sin\omega t$, the current is $C V\omega\cos\omega t$: amplitude $\omega C V$, a quarter cycle ahead. That's where a capacitor's impedance, $1/\omega C$ in size, comes from.

**Energy.** The power into a capacitor is $p = vi = Cv\,\frac{dv}{dt}$, which is the rate of change of $\tfrac12Cv^2$ (by the chain rule). So the energy stored is

$$E_C = \tfrac12 C v^2 \qquad\text{and likewise}\qquad E_L = \tfrac12 L i^2$$
:::

::: example
## The voltage across a 10 µF capacitor rises at 2000 V/s. What current flows?

::: solution
1. **Capacitor law.**
   $$\begin{aligned} i &= C\frac{dv}{dt} \\ &= 10 \times 10^{-6} \times 2000 \\ &= 0.02\ \text{A} \end{aligned}$$
   or 20 mA.
2. **What it means.** A steady current makes a steady ramp; doubling the rate doubles the current.

**Answer:** 20 mA flows.
:::
:::

::: example
## The current in a 5 mH inductor changes at 1000 A/s. What voltage appears?

::: solution
1. **Inductor law.**
   $$\begin{aligned} v &= L\frac{di}{dt} \\ &= 5 \times 10^{-3} \times 1000 \\ &= 5\ \text{V} \end{aligned}$$
2. **A faster change.** If the same change happened in a thousandth of the time, the voltage would be 5 kV, which is why switching off an inductor needs care.

**Answer:** 5 V appears across the inductor.
:::
:::

::: example
## A 100 µF capacitor has $v = 10\sin(2\pi \cdot 50\,t)$ V across it. What is the peak current?

::: solution
1. **Differentiate the voltage.**
   $$\begin{aligned} i &= C\frac{dv}{dt} \\ &= C \times 10 \times 2\pi \cdot 50 \cos(2\pi \cdot 50\,t) \end{aligned}$$
2. **Peak current.** The cosine peaks at 1:
   $$\begin{aligned} i_{\text{peak}} &= 100 \times 10^{-6} \\ &\quad \times 10 \times 314.2 \\ &= 0.314\ \text{A} \end{aligned}$$
3. **Timing.** The current peaks when the voltage crosses zero, where the voltage changes fastest, and it's zero at the voltage's peaks, where the slope is zero: the current leads by a quarter cycle.

**Answer:** the peak current is 0.314 A, and the current leads the voltage by a quarter cycle.
:::
:::

::: check
given: C = 100n..10µ E6 F; dv = 10..1000 sig 2
answer: C*dv
unit: A
tolerance: 1%

## The voltage across a {C} capacitor is rising at {dv} V/s. What current flows into it?

::: right
Right. $i = C\,dv/dt$ = {answer}.
:::

::: misses
- [dv/C] Multiply: $i = C\,dv/dt$.
- [C*dv*1e6] Check the prefix: the capacitance is in farads in the formula.
- [any] Not yet. Use $i = C\,dv/dt$.
:::
:::

::: check
given: L = 1m..100m E6 H; di = 10..1000 sig 2
answer: L*di
unit: V
tolerance: 1%

## The current through a {L} inductor is falling at {di} A/s. What is the size of the voltage across it?

::: right
Right. $|v| = L\,|di/dt|$ = {answer}.
:::

::: misses
- [di/L] Multiply: $v = L\,di/dt$.
- [any] Not yet. Use $v = L\,di/dt$.
:::
:::

::: check
given: C = 1µ..100µ E6 F; V = 5 | 10 | 12 | 24 | 50
answer: 0.5*C*V^2
unit: J
tolerance: 1%

## How much energy does a {C} capacitor store at {V}?

::: right
Right. $\tfrac12 C V^2$ = {answer}.
:::

::: misses
- [C*V^2] There's a factor of ½.
- [0.5*C*V] Square the voltage.
- [C*V] That's the charge, $q = CV$, in coulombs.
- [any] Not yet. Use $E = \tfrac12 CV^2$.
:::
:::

::: check
kind: choice

## A circuit with a capacitor and an inductor was connected to a battery long ago and has settled. What are the capacitor's current and the inductor's voltage?

- [x] Both zero
- [ ] Both equal to the battery's values
- [ ] The capacitor's current is large; the inductor's voltage is zero
- [ ] They oscillate forever

::: right
Right. Settled means nothing is changing, so $dv/dt = 0$ and $di/dt = 0$: no capacitor current, no inductor voltage.
:::

::: misses
- [2] Both depend on rates of change, and in a settled circuit nothing changes.
- [3] With the voltage steady, $C\,dv/dt = 0$.
- [4] Any real circuit has resistance, so oscillations die away.
:::
:::

::: check
kind: parts
given: C = 1 | 10 | 47; V = 5 | 12; T = 1 | 10

## A {C} µF capacitor's voltage ramps steadily from 0 to {V} V over {T} ms.

::: part
answer: C*1e-6*V/(T*1e-3)
unit: A
tolerance: 0.5%

### What current flows during the ramp?

::: misses
- [C*V/T] Use farads, volts and seconds.
- [any] $i = C\,dv/dt$, and $dv/dt$ is constant.
:::
:::

::: part
answer: 0.5*C*1e-6*V^2
unit: J
tolerance: 0.5%

### How much energy does it hold at the end?

::: misses
- [C*1e-6*V^2] The energy is $\tfrac12CV^2$.
- [any] $\tfrac12CV^2$.
:::
:::

::: part
answer: 0.5*C*1e-6*V^2/(T*1e-3)
unit: W
tolerance: 0.5%

### What is the average power delivered during the ramp?

::: misses
- [C*1e-6*V^2/(T*1e-3)] That's the peak power, at the end of the ramp. Average it.
- [any] Energy over time.
:::
:::
:::

::: check
kind: derivation
vars: C = 0.000001..0.0001, V = 1..20, T = 0.001..0.01, t = 0..0.01

## A capacitor's voltage ramps as $v = Vt/T$. Derive the energy delivered by time $T$.

::: step
answer: C*V/T

### What current flows?
:::

::: step
answer: C*V^2*t/T^2

### What power $p = vi$ goes in at time $t$?
:::

::: step
answer: C*V^2/2

### Integrate $p$ from 0 to $T$.
:::

::: right
Right. The energy is $\tfrac12CV^2$, whatever the ramp's duration: it depends only on where the voltage ends up.
:::
:::

::: explain
## Why can't the voltage across a capacitor jump instantly from one value to another?

::: model
The current into a capacitor is $C$ times the rate of change of its voltage. An instant jump would mean an infinite rate of change, so an infinite current, delivering a finite amount of charge in zero time. No real source or wire can supply that, so the voltage always changes continuously, however fast. The same reasoning, with $v = L\,di/dt$, means an inductor's current can't jump.
:::
:::

::: practice

::: check
given: C = 10n..1µ E6 F; V = 1..10 int; f = 50 | 1000 | 10000
answer: 2*pi*f*C*V
unit: A
tolerance: 1%

## A {C} capacitor has $\given{V}\sin(2\pi \cdot \given{f}\, t)$ volts across it. What is the amplitude of its current?

::: misses
- [C*V] Multiply by ω as well: the current is $C\,dv/dt$.
- [any] Amplitude $= \omega C V$ with $\omega = 2\pi f$.
:::
:::

::: check
given: L = 10m..1 E6 H; I = 0.1..2 sig 2; dt = 1µ..100µ E3 s
answer: L*I/dt
unit: V
tolerance: 1%

## A switch interrupts {I} A flowing in a {L} inductor, bringing it to zero in {dt}. Roughly how big a voltage does the inductor produce?

::: misses
- [L*I] Divide by the time: the voltage is $L\,\Delta i/\Delta t$.
- [any] $v \approx L\,\Delta i/\Delta t$.
:::
:::

::: check
given: L = 1m..100m E6 H; I = 0.1..5 sig 2
answer: 0.5*L*I^2
unit: J
tolerance: 1%

## How much energy does {L} store with {I} A flowing?

::: misses
- [L*I^2] There's a factor of ½.
- [any] $E = \tfrac12 L I^2$.
:::
:::

::: check
given: C = 1µ..100µ E6 F; V1 = 1..5 int; dV = 1..5 int; let V2 = V1 + dV
answer: C*dV
unit: C
tolerance: 1%

## A {C} capacitor charges from {V1} V to {V2} V. How much charge flowed in?

::: misses
- [C*V2] Only the change in voltage counts: $\Delta q = C\,\Delta v$.
- [any] $\Delta q = C\,\Delta v$.
:::
:::
:::
