---
title: Scalar and vector potentials
heading: Describing fields by what they're derivatives of
eyebrow: A9 · Lesson 44 · Potentials
xp: 40
---

::: hook
Voltage is easier to work with than electric field: one number per point instead of three, and it adds simply. A static electric field can always be written as $-\nabla V$ because it has no curl. A magnetic field has no divergence, so it can always be written as the curl of something, the **vector potential** $\mathbf A$. When fields change in time, the two potentials together give the electric field, and the time derivative of $\mathbf A$ is the induced field that drives a transformer.
:::

::: play
- A uniform field $B_0$ along $z$ has the vector potential $\mathbf A = \frac{B_0}{2}(-y, x, 0)$, circling the axis with size $\frac{B_0r}{2}$.
- The curve is $|\mathbf A|$ against distance from the axis, and the readout is $\oint\mathbf A\cdot d\mathbf l$ around a circle of radius $r_0$.
- That circulation equals the flux through the circle, $\pi r_0^2B_0$: the vector potential's loop integral is the flux it encloses.
:::

```sim plot
view: graph
x: r = 0..5 cm
y: A = 0..0.05 T·m
slider: B0 = 0.1..2 step 0.1 = 1 T
slider: r0 = 0.5..5 step 0.1 = 2 cm
plot: B0*r/100/2 | label: |A| = B₀r/2
marker: r = r0 | label: loop
readout: circulation of A, Wb = B0*r0/100/2*2*pi*r0/100 | digits: 4
readout: flux through the loop, Wb = pi*(r0/100)^2*B0 | digits: 4
```

::: predict
## Two different vector potentials, $\mathbf A$ and $\mathbf A + \nabla f$ for any smooth $f$, describe how many different magnetic fields?

- [x] One: they give the same $\mathbf B$
- [ ] Two
- [ ] It depends on $f$
- [ ] None, since $\mathbf A$ must be unique

::: reveal
One. $\nabla\times(\mathbf A + \nabla f) = \nabla\times\mathbf A + \nabla\times\nabla f = \nabla\times\mathbf A$, since a gradient has no curl. This freedom is called **gauge freedom**, like choosing which point is 0 V. A common choice, the Coulomb gauge, picks $f$ so that $\nabla\cdot\mathbf A = 0$.
:::
:::

::: nameit
## The scalar potential

If $\nabla\times\mathbf E = \mathbf 0$ (true for static fields), then $\mathbf E = -\nabla V$, and the voltage between two points is

$$V_b - V_a = -\int_a^b\mathbf E\cdot d\mathbf l$$

the same along every path. $V$ is defined up to a constant: only differences matter.

## The vector potential

Because $\nabla\cdot\mathbf B = 0$ always, $\mathbf B = \nabla\times\mathbf A$ for some $\mathbf A$. By Stokes's theorem,

$$\oint_C\mathbf A\cdot d\mathbf l = \iint_S\mathbf B\cdot d\mathbf S = \Phi$$

the flux through any surface bounded by $C$. Examples:
- uniform $\mathbf B = B_0\hat{\mathbf z}$: $\mathbf A = \frac{B_0}{2}(-y, x, 0)$, circling with size $\frac{B_0r}{2}$;
- a long straight wire: $\mathbf A$ points along the wire with $A_z = -\frac{\mu_0I}{2\pi}\ln r$ plus a constant;
- for any current distribution in the Coulomb gauge, $\mathbf A = \frac{\mu_0}{4\pi}\int\frac{\mathbf J\,dV}{|\mathbf r - \mathbf r'|}$, parallel to the currents that make it.

## Fields that change

Faraday's law says $\nabla\times\mathbf E = -\frac{\partial\mathbf B}{\partial t} = -\nabla\times\frac{\partial\mathbf A}{\partial t}$, so $\mathbf E + \frac{\partial\mathbf A}{\partial t}$ has no curl and is a gradient:

$$\mathbf E = -\nabla V - \frac{\partial\mathbf A}{\partial t}$$

The second term is the induced electric field. Around a loop it gives the EMF $-\frac{d\Phi}{dt}$, and it's what pushes current in a transformer's secondary even where $\mathbf B$ itself is zero outside the core.
:::

::: example
## Check that $\mathbf A = \frac{B_0}{2}(-y, x, 0)$ gives a uniform field $B_0\hat{\mathbf z}$.

::: solution
1. **The curl's $z$ component.**
   $$\begin{aligned} (\nabla\times\mathbf A)_z &= \frac{\partial A_y}{\partial x} - \frac{\partial A_x}{\partial y} \\ &= \frac{B_0}{2} - \left(-\frac{B_0}{2}\right) \\ &= B_0 \end{aligned}$$
2. **The other components.** The $x$ and $y$ components vanish because nothing depends on $z$.
3. **Another choice.** $\mathbf A = (0, B_0x, 0)$ gives the same field: they differ by the gradient of $\frac{B_0xy}{2}$. Different potentials, same physics.

**Answer:** $\nabla\times\mathbf A = B_0\hat{\mathbf z}$, a uniform field.
:::
:::

::: example
## A uniform 0.5 T field fills a region. Find the flux through a circle of radius 2 cm from the vector potential.

::: solution
1. **Size of $\mathbf A$ on the circle.** It's tangent there, with size
   $$\begin{aligned} \frac{B_0r}{2} &= \frac{0.5 \times 0.02}{2} \\ &= 0.005\ \text{T·m} \end{aligned}$$
2. **Circulation.** That times the circumference:
   $$\begin{aligned} \oint\mathbf A\cdot d\mathbf l &= 0.005 \times 2\pi(0.02) \\ &= 6.28 \times 10^{-4}\ \text{Wb} \end{aligned}$$
3. **Check directly.** It equals $\pi r^2B_0 = \pi(0.02)^2(0.5)$, the flux computed directly.

**Answer:** the flux is $6.28 \times 10^{-4}$ Wb.
:::
:::

::: example
## A long solenoid's field rises at 10 T/s. What electric field is induced 1 cm from its axis, inside?

::: solution
1. **Vector potential inside.**
   $$\mathbf A = \frac{B(t)}{2}(-y, x, 0)$$
   so the induced field is $-\frac{\partial\mathbf A}{\partial t}$, circling the axis.
2. **Its size.**
   $$\begin{aligned} E &= \frac r2\frac{dB}{dt} \\ &= \frac{0.01}{2} \times 10 \\ &= 0.05\ \text{V/m} \end{aligned}$$
3. **Check with Faraday's law.** On a circle:
   $$E \cdot 2\pi r = \pi r^2\frac{dB}{dt}$$
   gives the same result.
4. **EMF around the circle.** Around that 1 cm circle:
   $$\pi(0.01)^2 \times 10 = 3.1\ \text{mV}$$

**Answer:** a circling field of 0.05 V/m, an EMF of 3.1 mV around the 1 cm circle.
:::
:::

::: check
given: E0 = 100 | 500; x = 0.02 | 0.05
answer: -E0*x
unit: V
tolerance: 0.5%

## A uniform field $\mathbf E = (\given{E0}, 0, 0)$ V/m. Taking $V = 0$ at the origin, what is $V$ at $x$ = {x} m?

::: right
Right. $V = -\int_0^x E_0\,dx = -E_0x$ = {answer}: the potential falls along the field.
:::

::: misses
- [E0*x] The field points from high to low potential.
- [any] Not yet. $V_b - V_a = -\int\mathbf E\cdot d\mathbf l$.
:::
:::

::: check
given: B0 = 0.2 | 1.5; r = 1 | 3
answer: B0*r/100/2
unit: T·m
tolerance: 0.5%

## A uniform field of {B0} T is described by $\mathbf A = \frac{B_0}{2}(-y, x, 0)$. What is $|\mathbf A|$ at {r} cm from the axis?

::: right
Right. $\frac{B_0r}{2}$ = {answer}.
:::

::: misses
- [B0*r/100] There's a factor $\frac12$.
- [any] Not yet. $|\mathbf A| = \frac{B_0}{2}\sqrt{x^2 + y^2}$.
:::
:::

::: check
given: r = 0.5 | 2; dB = 5 | 20
answer: r/100/2*dB
unit: V/m
tolerance: 0.5%

## Inside a solenoid whose field rises at {dB} T/s, what electric field is induced {r} cm from the axis?

::: right
Right. $E = \frac r2\frac{dB}{dt}$ = {answer}.
:::

::: misses
- [r/100*dB] Faraday on a circle: $E \cdot 2\pi r = \pi r^2\frac{dB}{dt}$, so a factor $\frac12$.
- [any] Not yet. Use $\oint\mathbf E\cdot d\mathbf l = -\frac{d\Phi}{dt}$.
:::
:::

::: check
given: I = 1 | 10; r1 = 1 | 2; r2 = 4 | 10
answer: 2e-7*I*ln(r2/r1)
unit: T·m
tolerance: 0.5%

## A long wire carries {I} A, with $A_z = -\frac{\mu_0I}{2\pi}\ln r$. How much larger is $A_z$ at {r1} cm than at {r2} cm?

::: right
Right. $\frac{\mu_0I}{2\pi}\ln\frac{r_2}{r_1}$ = {answer}. This difference times the length of a rectangle's sides is the flux through a rectangle beside the wire.
:::

::: misses
- [2e-7*I*log(r2/r1)] Use the natural logarithm.
- [any] Not yet. Subtract the two values of $A_z$.
:::
:::

::: check
kind: parts
given: B0 = 0.1 | 0.5; R = 1 | 3

## A uniform field of {B0} T has $\mathbf A = \frac{B_0}{2}(-y, x, 0)$. Consider a circle of radius {R} cm around the axis.

::: part
answer: B0*R/100/2*2*pi*R/100
unit: Wb
tolerance: 0.5%

### What is $\oint\mathbf A\cdot d\mathbf l$ around it?

::: misses
- [any] $|\mathbf A| = \frac{B_0R}{2}$ times $2\pi R$.
:::
:::

::: part
answer: pi*(R/100)^2*B0
unit: Wb
tolerance: 0.5%

### What is the flux through it, computed from $\mathbf B$ directly?

::: misses
- [any] $\pi R^2B_0$: the same, by Stokes's theorem.
:::
:::
:::

::: check
kind: derivation
vars: B = 0.1..2, x = -2..2, y = -2..2

## Compare two vector potentials for $\mathbf B = B\hat{\mathbf z}$: $\mathbf A_1 = \frac B2(-y, x, 0)$ and $\mathbf A_2 = (0, Bx, 0)$.

::: step
answer: B*y/2

### What is the $x$ component of $\mathbf A_2 - \mathbf A_1$?
:::

::: step
answer: B*x/2

### What is its $y$ component?
:::

::: right
Right. $\mathbf A_2 - \mathbf A_1 = \frac B2(y, x, 0) = \nabla\frac{Bxy}{2}$: a gradient, which adds no curl.
:::
:::

::: check
kind: python

## For $\mathbf A = \frac{B_0}{2}(-y, x, 0)$ with $B_0$ = 0.8 T, compute the curl's $z$ component numerically on a grid with `np.gradient` (101 × 101 over $[-1, 1]^2$) and set `Bz` to its value at the center. Then set `circ` to $\oint\mathbf A\cdot d\mathbf l$ around the circle of radius 0.5, summed over 10 000 midpoint segments, and `flux` to $\pi(0.5)^2B_0$.

```python starter
import numpy as np

Bz = circ = flux = 0.0
print(Bz, circ, flux)
```

```python solution
import numpy as np

B0 = 0.8
x = np.linspace(-1, 1, 101)
h = x[1] - x[0]
X, Y = np.meshgrid(x, x, indexing="ij")
Ax, Ay = -B0 / 2 * Y, B0 / 2 * X
curl = np.gradient(Ay, h, axis=0) - np.gradient(Ax, h, axis=1)
Bz = curl[50, 50]
n = 10000
t = (np.arange(n) + 0.5) * 2 * np.pi / n
px, py = 0.5 * np.cos(t), 0.5 * np.sin(t)
dlx, dly = -0.5 * np.sin(t) * 2 * np.pi / n, 0.5 * np.cos(t) * 2 * np.pi / n
circ = np.sum(-B0 / 2 * py * dlx + B0 / 2 * px * dly)
flux = np.pi * 0.25 * B0
print(Bz, circ, flux)
```

```python tests
assert abs(Bz - 0.8) < 1e-9, f"The curl of A is the uniform field 0.8 T; got {Bz}."
assert abs(circ - flux) < 1e-9, f"The circulation of A equals the enclosed flux, {flux:.6f} Wb; got {circ}."
```

::: right
Right. Curl gives the field, and the loop integral gives the flux: the two faces of $\mathbf B = \nabla\times\mathbf A$.
:::
:::

::: explain
## A transformer's core confines its magnetic field, so outside the core $\mathbf B$ is nearly zero. How can the secondary winding, which sits outside the core, have a voltage induced in it?

::: model
The induced electric field is $-\frac{\partial\mathbf A}{\partial t}$, and $\mathbf A$ is not zero where $\mathbf B$ is: the vector potential circles the core, with a loop integral equal to the flux inside, wherever the loop is. As the core's flux changes, $\mathbf A$ changes along the winding, and its time derivative pushes charge around the turns. Faraday's law says the same in integral form: the EMF around a loop depends on the flux through the loop, not on the field at the wire. The potential just shows where, locally, the push comes from.
:::
:::

::: practice

::: check
given: r = 0.1..10; dB = 0.1..100
answer: r/100/2*dB
unit: V/m
tolerance: 0.5%

## Induced field in V/m, {r} cm from a solenoid's axis, field rising at {dB} T/s?

::: misses
- [any] $\frac r2\frac{dB}{dt}$.
:::
:::

::: check
given: B0 = 0.01..2; R = 0.1..10
answer: pi*(R/100)^2*B0
unit: Wb
tolerance: 0.5%

## Flux in Wb through a circle of {R} cm in {B0} T?

::: misses
- [any] $\pi R^2B_0$.
:::
:::
:::
