---
title: Relativity and electromagnetism
heading: How E and B transform between moving frames, the field invariants, magnetism as a relativistic effect, and the relativistic Doppler shift
eyebrow: S5 · Lesson 46 · Relativity and electromagnetism
xp: 50
---

::: hook
Maxwell's equations already obey special relativity; it took Einstein to notice. One observer's purely electric field is another observer's mix of electric and magnetic fields, and the magnetic force between two currents is, seen from the right frame, an ordinary electric force from a charge imbalance created by length contraction. That's remarkable for everyday currents, whose electrons drift at fractions of a millimeter per second: the relativistic effect is tiny, but it acts on an enormous number of charges, so it's large enough to turn motors. This lesson collects the transformation rules and shows where they matter in practice, from particle beams to the Doppler shifts of satellites and stars.
:::

::: play
- The relativistic Doppler factor, received over emitted frequency, against the source's speed β: approaching (solid), receding (dashed), and moving across the line of sight (dotted line, a redshift of 1/γ).
- At low speed the shift is about ±β, as in classical Doppler. The transverse shift has no classical counterpart: it's time dilation alone.
- The readout gives the frequency an observer receives from a 10 GHz source at the slider's speed.
:::
:::

```sim plot
view: graph
x: b = 0..0.95
y: r = 0..6
slider: s = 0..0.95 = 0.5
plot: sqrt((1 + b)/(1 - b)) | samples: 300 | label: approaching
plot: sqrt((1 - b)/(1 + b)) | samples: 300 | dashed | color: ch2 | label: receding
plot: sqrt(1 - b^2) | samples: 300 | dashed | color: ch3 | label: transverse
readout: received from 10 GHz, approaching, GHz = 10*sqrt((1 + s)/(1 - s))
```

::: predict
## A frame moves at 0.6c parallel to the plates of a capacitor whose field is 1 MV/m. What fields does an observer in that frame measure?

- [ ] 1 MV/m and no magnetic field
- [ ] 0.8 MV/m and 2 mT
- [x] 1.25 MV/m and 2.5 mT
- [ ] 1.25 MV/m and no magnetic field

::: reveal
The field is perpendicular to the motion, so it scales by γ = 1.25: the plates are contracted along the motion, crowding the same charge into less area. The moving plates are also currents, so there's a magnetic field $B' = \gamma vE/c^2$ = 1.25 × 0.6 × 10⁶/(3 × 10⁸) = 2.5 mT. The invariant $E^2 - c^2B^2$ is the same in both frames: (1 MV/m)².
:::
:::

::: nameit
## Transforming the fields

For a frame moving with velocity **v** relative to the lab, with $\gamma = 1/\sqrt{1 - v^2/c^2}$:

$$\mathbf{E}'_\parallel = \mathbf{E}_\parallel, \qquad \mathbf{E}'_\perp = \gamma(\mathbf{E} + \mathbf{v}\times\mathbf{B})_\perp$$
$$\mathbf{B}'_\parallel = \mathbf{B}_\parallel, \qquad \mathbf{B}'_\perp = \gamma\left(\mathbf{B} - \frac{\mathbf{v}\times\mathbf{E}}{c^2}\right)_\perp$$

(∥ and ⊥ relative to **v**). Two combinations are the same in every frame:

$$E^2 - c^2B^2 \quad\text{and}\quad \mathbf{E}\cdot\mathbf{B}$$

So a field that's purely electric in one frame ($E > cB$) can never be made purely magnetic, and a plane wave ($E = cB$, $\mathbf{E}\perp\mathbf{B}$) is a plane wave in every frame. In the field-tensor language, E and B are parts of one antisymmetric four-dimensional object.

## Magnetism from electricity

A charge moving parallel to a current-carrying wire feels the magnetic force $qvB$ in the lab. In the charge's own frame it's at rest, so there's no magnetic force on it, yet it's still pushed: the wire's positive and negative charges, moving at different speeds in that frame, are length-contracted differently, so the wire carries a net charge and exerts an electric force. Both frames agree on the outcome.

## The relativistic Doppler shift

A source moving at βc relative to an observer:

- along the line of sight: $f' = f\sqrt{\frac{1 + \beta}{1 - \beta}}$ approaching, the inverse receding;
- across the line of sight: $f' = f/\gamma$, the transverse shift from time dilation alone.
:::

::: example
## A 10 GHz source approaches at 0.5c. What frequency arrives? What if it recedes, or moves across the line of sight?

::: solution
1. **Approaching.**
   $$\begin{aligned} f &= 10\sqrt{\frac{1.5}{0.5}}\ \text{GHz} \\ &= 17.3\ \text{GHz} \end{aligned}$$
2. **Receding.**
   $$\begin{aligned} f &= 10\sqrt{\frac{0.5}{1.5}}\ \text{GHz} \\ &= 5.77\ \text{GHz} \end{aligned}$$
3. **Across the line of sight.**
   $$\begin{aligned} f &= 10\sqrt{1 - 0.25}\ \text{GHz} \\ &= 8.66\ \text{GHz} \end{aligned}$$
4. **GPS.** GPS clocks correct for the analogous time dilation (and for gravity) because their navigation errors would otherwise grow by kilometers a day.

**Answer:** 17.3 GHz arrives from the approaching source, 5.77 GHz from the receding one and 8.66 GHz from one moving across the line of sight.
:::
:::

::: example
## An electron moves at 10⁵ m/s parallel to a wire carrying 10 A, 1 cm away. What force does it feel, and in its own frame, where does that force come from?

::: solution
1. **Field of the wire.**
   $$\begin{aligned} B &= \frac{\mu_0I}{2\pi r} \\ &= 0.2\ \text{mT} \end{aligned}$$
2. **Force in the lab.**
   $$\begin{aligned} F &= evB \\ &= 3.2 \times 10^{-18}\ \text{N} \end{aligned}$$
3. **In the electron's frame.** The electron is at rest there, and the wire, whose ions and conduction electrons move at different speeds in that frame, carries a small net line charge whose electric field exerts exactly the same force.

**Answer:** the electron feels $3.2 \times 10^{-18}$ N; in its own frame that force comes from the electric field of the wire's net line charge.
:::
:::

::: example
## A lab has a pure electric field of 1 MV/m. An observer moves at 0.6c perpendicular to it. What fields do they measure, and what stays the same?

::: solution
1. **Lorentz factor.** At 0.6c, γ = 1.25.
2. **Electric field.**
   $$\begin{aligned} E' &= \gamma E \\ &= 1.25\ \text{MV/m} \end{aligned}$$
3. **Magnetic field.** A magnetic field appears:
   $$\begin{aligned} B' &= \frac{\gamma vE}{c^2} \\ &= 2.5\ \text{mT} \end{aligned}$$
4. **The invariant.**
   $$\begin{aligned} E^2 - c^2B^2 &= (1.25 \times 10^6)^2 \\ &\quad - (3 \times 10^8 \times 2.5 \times 10^{-3})^2 \\ &= 10^{12}\ (\text{V/m})^2 \end{aligned}$$
   the same as the lab's: no observer can see this field as purely magnetic.

**Answer:** the observer measures E′ = 1.25 MV/m and B′ = 2.5 mT, and $E^2 - c^2B^2$ stays $10^{12}$ (V/m)².
:::
:::

::: check
given: E = 0.1 | 1 | 10; b = 0.3 | 0.6 | 0.9
answer: E/sqrt(1 - b^2)
unit: MV/m
tolerance: 0.5%

## A frame moves at {b}c parallel to a capacitor's plates, whose field is {E} MV/m. What electric field does it measure?

::: right
Right. The perpendicular field grows by γ: {answer} MV/m.
:::

::: misses
- [E] The field is perpendicular to the motion: it transforms by γ.
- [E*sqrt(1 - b^2)] It grows: the plates' charge is crowded into a contracted area.
- [any] Not yet. $E'_\perp = \gamma E_\perp$.
:::
:::

::: check
given: E = 0.1 | 1 | 10; b = 0.3 | 0.6 | 0.9
answer: E*1e6*b/299792458/sqrt(1 - b^2)*1000
unit: mT
tolerance: 0.5%

## In that same moving frame, how strong is the magnetic field?

::: right
Right. $\gamma vE/c^2$ = {answer} mT.
:::

::: misses
- [E*1e6*b/299792458*1000] Include γ.
- [any] Not yet. $B'_\perp = -\gamma(\mathbf{v}\times\mathbf{E})_\perp/c^2$.
:::
:::

::: check
given: b = 0.1 | 0.5 | 0.9; f = 1 | 10
answer: f*sqrt((1 + b)/(1 - b))
unit: GHz
tolerance: 0.5%

## A {f} GHz source approaches at {b}c. What frequency is received?

::: right
Right. $f\sqrt{\frac{1 + \beta}{1 - \beta}}$ = {answer} GHz.
:::

::: misses
- [f*(1 + b)] That's the low-speed approximation.
- [f*sqrt((1 - b)/(1 + b))] That's for a receding source.
- [any] Not yet. The relativistic Doppler formula.
:::
:::

::: check
given: b = 0.3 | 0.6 | 0.9; f = 1 | 10
answer: f*sqrt(1 - b^2)
unit: GHz
tolerance: 0.5%

## A {f} GHz source moves across the line of sight at {b}c. What frequency is received at closest approach?

::: right
Right. $f/\gamma$ = {answer} GHz: time dilation.
:::

::: misses
- [f] Classical Doppler gives no shift here; relativity does.
- [any] Not yet. Only time dilation acts.
:::
:::

::: check
given: E = 1 | 3; B = 1 | 5
answer: (E*1e6)^2 - (299792458*B*1e-3)^2
unit: V^2/m^2
tolerance: 0.5%

## In some frame, E = {E} MV/m and B = {B} mT. What's the invariant $E^2 - c^2B^2$?

::: right
Right. {answer} V²/m², the same in every frame.
:::

::: misses
- [(E*1e6)^2 + (299792458*B*1e-3)^2] It's a difference, like a spacetime interval.
- [any] Not yet. $E^2 - c^2B^2$ in SI units.
:::
:::

::: check
given: I = 1 | 10 | 100; r = 0.5 | 2; v = 1e4 | 1e6
answer: 1.602176634e-19*v*4e-7*pi*I/(2*pi*r*0.01)*1e18
unit: aN
tolerance: 0.5%

## An electron moves at {v} m/s parallel to a wire carrying {I} A, {r} cm away. What force does it feel?

::: right
Right. $ev\mu_0I/2\pi r$ = {answer} aN.
:::

::: misses
- [any] Not yet. $F = evB$ with $B = \mu_0I/2\pi r$.
:::
:::

::: check
kind: parts
given: f = 1 | 10; b = 0.1 | 0.5 | 0.9

## A {f} GHz source moves at {b}c.

::: part
answer: f*sqrt((1 + b)/(1 - b))
unit: GHz
tolerance: 0.5%

### What frequency arrives when it approaches?

::: misses
- [f*(1 + b)] That's the nonrelativistic shift.
- [any] $f\sqrt{(1 + \beta)/(1 - \beta)}$.
:::
:::

::: part
answer: f*sqrt(1 - b^2)
unit: GHz
tolerance: 0.5%

### And when it moves across the line of sight?

::: misses
- [any] $f/\gamma$.
:::
:::
:::

::: check
kind: parts
given: E = 1 | 10; b = 0.3 | 0.6 | 0.8

## A lab has a pure electric field of {E} MV/m; an observer moves at {b}c perpendicular to it.

::: part
answer: E/sqrt(1 - b^2)
unit: MV/m
tolerance: 0.5%

### What electric field do they measure?

::: misses
- [any] $\gamma E$.
:::
:::

::: part
answer: b*E*1e6/sqrt(1 - b^2)/299792458*1000
unit: mT
tolerance: 0.5%

### What magnetic field do they measure?

::: misses
- [any] $\gamma vE/c^2$.
:::
:::
:::

::: check
kind: derivation
vars: b = 0.01..0.99

## A source moves at βc = b c.

::: step
answer: 1/sqrt(1 - b^2)

### What is γ?
:::

::: step
answer: sqrt((1 + b)/(1 - b))

### What is the Doppler factor approaching?
:::

::: step
answer: sqrt((1 - b)/(1 + b))

### And receding?
:::

::: right
Right. The two longitudinal factors are reciprocals, and their geometric mean is 1: the transverse $1/\gamma$ lies between them.
:::
:::

::: explain
## How can the magnetic force between currents be explained as an electric force, when the drift speed of electrons in a wire is so tiny?

::: model
In a current-carrying wire the positive ions and the drifting electrons have equal and opposite charge densities in the lab, so the wire is neutral. Seen by a charge moving alongside, the ions and electrons move at different speeds, so their spacings are length-contracted by different amounts, and their densities no longer cancel: the wire has a small net charge and pushes the moving charge electrically. The imbalance is of order v²/c², about 10⁻²⁴ for millimeter-per-second drifts, which sounds negligible. But a wire contains about 10²³ conduction electrons per cubic centimeter whose charge is otherwise perfectly balanced, so even that tiny fraction of an enormous charge gives forces large enough to drive motors. Magnetism is the relativistic correction to electrostatics that survives because matter is so precisely neutral.
:::
:::

::: practice

::: check
given: E = 0.5 | 5; b = 0.4 | 0.8
answer: E/sqrt(1 - b^2)
unit: MV/m
tolerance: 0.5%

## E′ for a frame at {b}c parallel to plates with {E} MV/m?

::: misses
- [any] γE.
:::
:::

::: check
given: b = 0.2 | 0.7; f = 2 | 20
answer: f*sqrt((1 + b)/(1 - b))
unit: GHz
tolerance: 0.5%

## Received from {f} GHz approaching at {b}c?

::: misses
- [any] $f\sqrt{(1 + \beta)/(1 - \beta)}$.
:::
:::

::: check
given: b = 0.5 | 0.95; f = 3 | 30
answer: f*sqrt(1 - b^2)
unit: GHz
tolerance: 0.5%

## Transverse Doppler: {f} GHz at {b}c?

::: misses
- [any] $f/\gamma$.
:::
:::
:::
