PHYS-244 · Lesson 6 of 12 · 26 min

Motion in three dimensions and vector calculus tools

In one dimension every position-dependent force has a potential, and energy conservation solves the problem. In three dimensions neither statement is automatic. Forces can depend on all three coordinates and on velocity in ways that do no work, the right choice of coordinates can turn a hard problem into an easy one, and a force must pass a test before a potential exists. This lesson collects the tools: velocity and acceleration in polar and spherical coordinates, the gradient and curl, the criterion for a force to be conservative, and the motion of a charged particle in magnetic and electric fields, which is the standard example of a velocity-dependent force that does no work.

Polar coordinates in a plane

Many problems, including all the central-force problems of lessons 7 to 9, are naturally described by the distance \(r\) from a centre and the angle \(\phi\). Introduce unit vectors \(\hat{\mathbf r} = (\cos\phi, \sin\phi)\) pointing outward and \(\hat{\boldsymbol\phi} = (-\sin\phi, \cos\phi)\) pointing in the direction of increasing angle. Unlike \(\hat{\mathbf x}\) and \(\hat{\mathbf y}\), these unit vectors change as the particle moves: differentiating,

\[\dot{\hat{\mathbf r}} = \dot\phi\,\hat{\boldsymbol\phi}, \qquad \dot{\hat{\boldsymbol\phi}} = -\dot\phi\,\hat{\mathbf r}.\]

With \(\mathbf r = r\hat{\mathbf r}\), the velocity is \(\dot{\mathbf r} = \dot r\hat{\mathbf r} + r\dot\phi\,\hat{\boldsymbol\phi}\), and differentiating once more,

\[\ddot{\mathbf r} = \big(\ddot r - r\dot\phi^2\big)\hat{\mathbf r} + \big(r\ddot\phi + 2\dot r\dot\phi\big)\hat{\boldsymbol\phi}.\]

Each term has a meaning. \(\ddot r\) is the obvious radial acceleration. \(-r\dot\phi^2\) is the centripetal acceleration, present even at constant \(r\). \(r\ddot\phi\) is the tangential acceleration from changing angular speed. The last term, \(2\dot r\dot\phi\), is the Coriolis term: a particle moving outward while turning must speed up sideways, because points further out move faster at the same angular speed. The transverse component can be written \(\frac1r\frac{d}{dt}(r^2\dot\phi)\). If the force has no transverse component, \(r^2\dot\phi\) is constant, which is the conservation of angular momentum per unit mass and the key to lesson 7.

Cylindrical and spherical coordinates

Adding a height \(z\) to polar coordinates gives cylindrical coordinates, useful for anything with an axis of symmetry: a bead on a rotating rod, a charge spiralling along a magnetic field line, water in a draining tub. Spherical coordinates \((r, \theta, \phi)\), with \(\theta\) measured from the \(z\) axis, suit problems with a centre: gravity, the Coulomb force, a spherical pendulum. The velocity in spherical coordinates is

\[\dot{\mathbf r} = \dot r\,\hat{\mathbf r} + r\dot\theta\,\hat{\boldsymbol\theta} + r\sin\theta\,\dot\phi\,\hat{\boldsymbol\phi},\]

so the kinetic energy is \(\tfrac12m\big(\dot r^2 + r^2\dot\theta^2 + r^2\sin^2\theta\,\dot\phi^2\big)\). The accelerations are longer and are usually best obtained through the Lagrangian method of PHYS-344, but this kinetic energy is often all you need: combined with a potential energy and the conserved quantities of the problem, it gives the motion directly.

Worked problem

A bead on a rotating rod

A bead slides without friction on a straight horizontal rod that is forced to rotate about a vertical axis at constant angular speed \(\Omega\). The bead starts at rest relative to the rod at distance \(r_0\). Find \(r(t)\) and the force the rod exerts.

Show solution
  1. The rod can push only perpendicular to itself, in the \(\hat{\boldsymbol\phi}\) direction, so the radial equation has no force: \(\ddot r - r\Omega^2 = 0\).
  2. The solution with \(r(0) = r_0\), \(\dot r(0) = 0\) is \(r = r_0\cosh\Omega t\): the bead slides out exponentially.
  3. The transverse equation gives the rod's force: \(F_\phi = m(r\ddot\phi + 2\dot r\dot\phi) = 2m\Omega\dot r = 2m\Omega^2r_0\sinh\Omega t\).

Answer: \(r = r_0\cosh\Omega t\), with the rod pushing sideways with force \(2m\Omega\dot r\). That push is entirely the Coriolis term; it is what keeps the bead turning with the rod as it moves outward, and the motor driving the rod must supply the corresponding torque.

The gradient and conservative forces

In three dimensions a force field \(\mathbf F(\mathbf r)\) is conservative if the work \(\int\mathbf F\cdot d\mathbf r\) between any two points is the same along every path. Equivalently, the work around every closed loop is zero. When that holds, the potential energy \(U(\mathbf r) = -\int_{\mathbf r_0}^{\mathbf r}\mathbf F\cdot d\mathbf r\) is well defined, and the force is recovered as minus its gradient,

\[\mathbf F = -\nabla U = -\Big(\frac{\partial U}{\partial x}, \frac{\partial U}{\partial y}, \frac{\partial U}{\partial z}\Big).\]

The gradient points in the direction in which \(U\) increases fastest, and its magnitude is that fastest rate. The force therefore points straight downhill on the potential energy surface. Surfaces of constant \(U\) are perpendicular to the force everywhere, which is why a ball released on a smooth hillside starts moving perpendicular to the contour lines.

How can we tell whether a given force is conservative without checking every loop? Stokes' theorem converts the work around a small loop into a local quantity. The work around a closed curve \(C\) bounding a surface \(S\) is

\[\oint_C\mathbf F\cdot d\mathbf r = \iint_S(\nabla\times\mathbf F)\cdot d\mathbf A,\]

where the curl \(\nabla\times\mathbf F\) has components \(\big(\partial_yF_z - \partial_zF_y,\ \partial_zF_x - \partial_xF_z,\ \partial_xF_y - \partial_yF_x\big)\). If the curl vanishes everywhere in a region with no holes, the work around every loop in it vanishes, and the force is conservative. Conversely, if \(\mathbf F = -\nabla U\) then \(\nabla\times\mathbf F = 0\) automatically, because mixed partial derivatives commute.

The program checks three forces. The first, \((2xy, x^2, 0)\), is the gradient of \(-x^2y\), so its curl is zero and the work around a closed square vanishes. The second, \((-y, x, 0)\), circulates around the \(z\) axis; its curl is \(2\hat{\mathbf z}\) and the work around the unit square equals 2, the curl times the area, exactly as Stokes' theorem says. The third is an inverse-square central force, whose curl vanishes away from the origin. Every central force whose magnitude depends only on \(r\) is conservative, with \(U(r) = -\int F(r)\,dr\).

Testing forces for zero curl, and the drift of a proton in crossed electric and magnetic fields
import math

# 1. Is a force conservative? Check the curl numerically and the work around a closed square loop.
def curl(F, x, y, z, h=1e-5):
    d = lambda i, j: (F(*[c + h * (k == j) for k, c in enumerate((x, y, z))])[i]
                      - F(*[c - h * (k == j) for k, c in enumerate((x, y, z))])[i]) / (2 * h)
    return (d(2, 1) - d(1, 2), d(0, 2) - d(2, 0), d(1, 0) - d(0, 1))

def loop_work(F, n=4000):
    # counterclockwise unit square in the xy-plane, corner at the origin
    W, corners = 0.0, [(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)]
    for (x1, y1), (x2, y2) in zip(corners, corners[1:]):
        for i in range(n):
            s = (i + 0.5) / n
            x, y = x1 + s * (x2 - x1), y1 + s * (y2 - y1)
            Fx, Fy, _ = F(x, y, 0.0)
            W += Fx * (x2 - x1) / n + Fy * (y2 - y1) / n
    return W

forces = {
    "F = (2xy, x^2, 0)": lambda x, y, z: (2 * x * y, x * x, 0.0),
    "F = (-y, x, 0)": lambda x, y, z: (-y, x, 0.0),
    "F = -r / |r|^3 at (1,2,2)": lambda x, y, z: tuple(-c / (x * x + y * y + z * z) ** 1.5 for c in (x, y, z)),
}
for name, F in forces.items():
    cx, cy, cz = (0.0 if abs(u) < 1e-7 else u for u in curl(F, 1.0, 2.0, 2.0))
    print(f"{name:26s} curl = ({cx:+.4f}, {cy:+.4f}, {cz:+.4f})")
for name in list(forces)[:2]:
    w = loop_work(forces[name]); print(f"work around the unit square for {name}: {0.0 if abs(w) < 1e-9 else w:+.4f}")

# 2. A proton in a magnetic field B = 0.10 T along z, with an electric field E = 1000 V/m along x
q, m, B, E = 1.602e-19, 1.673e-27, 0.10, 1000.0
wc = q * B / m
def acc(v):
    vx, vy, vz = v
    return ((q / m) * (E + vy * B), (q / m) * (-vx * B), 0.0)   # q (E + v x B) / m
x, v, T = [0.0, 0.0, 0.0], [0.0, 0.0, 2.0e3], 2 * math.pi / wc
dt = T / 2000
for _ in range(20 * 2000):                         # twenty cyclotron periods, RK4 on (r, v)
    def f(s): a = acc(s[3:]); return list(s[3:]) + list(a)
    s = x + v
    k1 = f(s); k2 = f([a + dt / 2 * b for a, b in zip(s, k1)])
    k3 = f([a + dt / 2 * b for a, b in zip(s, k2)]); k4 = f([a + dt * b for a, b in zip(s, k3)])
    s = [a + dt / 6 * (b1 + 2 * b2 + 2 * b3 + b4) for a, b1, b2, b3, b4 in zip(s, k1, k2, k3, k4)]
    x, v = s[:3], s[3:]
t = 20 * T
print(f"cyclotron frequency = {wc:.4e} rad/s, period = {T * 1e6:.4f} microseconds")
print(f"after 20 periods: drift speed in y = {x[1] / t:.1f} m/s (E/B = {E / B:.1f}, direction -y), z speed = {x[2] / t:.1f} m/s")
Output
F = (2xy, x^2, 0)          curl = (+0.0000, +0.0000, +0.0000)
F = (-y, x, 0)             curl = (+0.0000, +0.0000, +2.0000)
F = -r / |r|^3 at (1,2,2)  curl = (+0.0000, +0.0000, +0.0000)
work around the unit square for F = (2xy, x^2, 0): +0.0000
work around the unit square for F = (-y, x, 0): +2.0000
cyclotron frequency = 9.5756e+06 rad/s, period = 0.6562 microseconds
after 20 periods: drift speed in y = -10000.0 m/s (E/B = 10000.0, direction -y), z speed = 2000.0 m/s

The caveat about holes

The curl test needs a region without holes. The field \(\mathbf F = (-y, x, 0)/(x^2 + y^2)\), which circulates around the \(z\) axis with strength falling as \(1/r\), has zero curl everywhere except on the axis itself, where it is undefined. Yet the work around any circle enclosing the axis is \(2\pi\), not zero. The field is conservative in any region that excludes the axis and cannot wrap around it, but not in a region that encircles it. This is the magnetic field of a long straight wire, up to constants, and the nonzero loop integral is Ampère's law: the line integral of \(\mathbf B\) around a wire measures the current through it.

Charged particles in magnetic fields

The Lorentz force on a charge \(q\) is \(\mathbf F = q(\mathbf E + \mathbf v\times\mathbf B)\). The magnetic part is always perpendicular to the velocity, so it does no work: \(\mathbf F\cdot\mathbf v = q(\mathbf v\times\mathbf B)\cdot\mathbf v = 0\). A magnetic field alone can bend a charged particle's path but never change its speed. It is the standard example of a velocity-dependent force that conserves kinetic energy without being the gradient of any potential.

In a uniform field \(\mathbf B = B\hat{\mathbf z}\), the velocity component along \(z\) is unaffected, and the perpendicular components obey \(\dot v_x = \omega_cv_y\), \(\dot v_y = -\omega_cv_x\), with the cyclotron frequency

\[\omega_c = \frac{|q|B}{m}.\]

The perpendicular velocity rotates at \(\omega_c\), independent of speed, and the particle moves on a helix with radius \(r_c = mv_\perp/|q|B\). The speed independence is what made Ernest Lawrence's cyclotron of 1931 possible: particles spiral outward as they gain energy, but each half-turn takes the same time, so a fixed-frequency voltage can kick them on every pass. The same physics traps charged particles in the Earth's Van Allen belts, sends them spiralling down field lines into the polar atmosphere to make the aurora, and lets a mass spectrometer sort ions by their radius of curvature.

Crossed electric and magnetic fields

Add a uniform electric field \(\mathbf E\) perpendicular to \(\mathbf B\). In a frame moving at velocity \(\mathbf v_d = \mathbf E\times\mathbf B/B^2\), the electric force is exactly cancelled by the magnetic force on the frame velocity, since \(q(\mathbf E + \mathbf v_d\times\mathbf B) = 0\) for perpendicular fields. In that frame the particle simply circles; in the original frame the circle drifts at \(\mathbf v_d\). A particle starting from rest traces a cycloid, the curve drawn by a point on the rim of a rolling wheel. Remarkably, the drift velocity is independent of the charge and mass: electrons and protons drift together in the same direction.

A blue curve made of three identical arches, like the path of a point on the rim of a rolling wheel, starting at rest on the left and moving to the right. Below it, a red arrow pointing up is labelled E, a circled dot is labelled B out of the page, and a green arrow pointing right is labelled drift v equals E cross B over B squared.
A positive charge released from rest in crossed fields follows a cycloid. It is pushed along \(\mathbf E\), bent by \(\mathbf B\), stopped and pushed again, drifting steadily along \(\mathbf E\times\mathbf B\).

The numerical run in the program confirms this for a proton in a 0.10 T field with a 1000 V/m electric field. The cyclotron period is 0.656 μs; after twenty periods the average velocity across the fields is exactly \(E/B = 10^4\ \mathrm{m/s}\) in the \(-y\) direction, and the initial 2000 m/s along \(\mathbf B\) is untouched. The direction follows from \(\hat{\mathbf x}\times\hat{\mathbf z} = -\hat{\mathbf y}\). The same drift, with gravity or field gradients playing the role of \(\mathbf E\), governs the slow motion of plasma in fusion devices and in the magnetosphere, and the \(\mathbf E\times\mathbf B\) drift of electrons is how a magnetron in a microwave oven generates its oscillations.

Worked problem

A velocity selector

A beam of ions passes between plates with \(E = 4.0\times10^4\ \mathrm{V/m}\) in a perpendicular magnetic field of 0.080 T. Which speed passes undeflected, and what radius does a singly charged ion of mass 20 u (\(3.32\times10^{-26}\ \mathrm{kg}\)) at that speed follow when it leaves the plates into the magnetic field alone?

Show solution
  1. Undeflected ions have zero net force: \(qE = qvB\), so \(v = E/B = 5.0\times10^5\ \mathrm{m/s}\).
  2. In the magnetic field alone, \(r = mv/qB = 3.32\times10^{-26}(5.0\times10^5)/(1.60\times10^{-19}\cdot0.080) = 1.30\ \mathrm{m}\).

Answer: \(5.0\times10^5\ \mathrm{m/s}\) and a radius of 1.30 m. An ion of mass 22 u at the same speed would follow a radius 10% larger, which is how the first mass spectrometers separated the isotopes of neon in 1913.

Common mistakes

  • MistakeWriting the radial acceleration in polar coordinates as \(\ddot r\).

    InsteadInclude the centripetal term: \(a_r = \ddot r - r\dot\phi^2\).

  • MistakeForgetting that polar unit vectors change direction as the particle moves.

    InsteadDifferentiate them: \(\dot{\hat{\mathbf r}} = \dot\phi\hat{\boldsymbol\phi}\), \(\dot{\hat{\boldsymbol\phi}} = -\dot\phi\hat{\mathbf r}\).

  • MistakeConcluding that a force is conservative because it depends only on position.

    InsteadIn three dimensions the curl must also vanish, in a region without holes.

  • MistakeThinking a magnetic field can speed up a charged particle.

    InsteadThe magnetic force is perpendicular to the velocity and does no work.

  • MistakeExpecting oppositely charged particles to drift in opposite directions in crossed fields.

    InsteadThe drift \(\mathbf E\times\mathbf B/B^2\) does not depend on the charge.

Summary and key terms

  • In polar coordinates \(\mathbf a = (\ddot r - r\dot\phi^2)\hat{\mathbf r} + (r\ddot\phi + 2\dot r\dot\phi)\hat{\boldsymbol\phi}\); the transverse part is \(\frac1r\frac{d}{dt}(r^2\dot\phi)\).
  • Spherical kinetic energy: \(\tfrac12m(\dot r^2 + r^2\dot\theta^2 + r^2\sin^2\theta\,\dot\phi^2)\).
  • A force is conservative, \(\mathbf F = -\nabla U\), if its curl vanishes in a region without holes; then the work around every loop is zero.
  • Every central force depending only on \(r\) is conservative.
  • The magnetic force does no work; charges circle at \(\omega_c = |q|B/m\) on helices of radius \(mv_\perp/|q|B\).
  • In crossed fields charges drift at \(\mathbf E\times\mathbf B/B^2\), independent of charge and mass.
gradient
The vector of partial derivatives of a scalar field, pointing in the direction of fastest increase.
curl
The vector measuring the local circulation of a field; zero curl in a region without holes means the field is conservative.
Stokes' theorem
The circulation of a field around a closed curve equals the flux of its curl through any surface bounded by the curve.
Coriolis term
The 2 r-dot phi-dot part of the transverse acceleration in polar coordinates.
cyclotron frequency
The angular frequency qB over m at which a charge circles in a uniform magnetic field.
E cross B drift
The steady drift of charged particles across crossed electric and magnetic fields at speed E over B.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A particle moves on the spiral \(r = a\phi\) with constant \(\dot\phi = \omega\). Find its acceleration components.

    Show answer

    \(\dot r = a\omega\), \(\ddot r = 0\): \(a_r = -a\phi\omega^2\), \(a_\phi = 2a\omega^2\).

  2. Is \(\mathbf F = (yz, xz, xy)\) conservative? If so find \(U\).

    Show answer

    Its curl is \((x - x, y - y, z - z) = 0\); \(U = -xyz\).

  3. Compute the work done by \(\mathbf F = (-y, x, 0)\) around a circle of radius \(R\) about the origin.

    Show answer

    \(\mathbf F\cdot d\mathbf r = R^2d\phi\), so the work is \(2\pi R^2\), equal to the curl (2) times the area \(\pi R^2\).

  4. An electron (\(m = 9.11\times10^{-31}\ \mathrm{kg}\)) circles in a 1.0 mT field. Find its cyclotron frequency in hertz.

    Show answer

    \(f = eB/2\pi m = 1.60\times10^{-19}(10^{-3})/(2\pi\cdot9.11\times10^{-31}) = 28\ \mathrm{MHz}\).

  5. A 5.0 MeV proton moves perpendicular to a 1.5 T field. Find the radius of its path.

    Show answer

    \(v = \sqrt{2(5.0\times1.60\times10^{-13})/1.67\times10^{-27}} = 3.1\times10^7\ \mathrm{m/s}\); \(r = mv/qB = 0.22\ \mathrm{m}\).

  6. In crossed fields \(E = 200\ \mathrm{V/m}\) and \(B = 50\ \mu\mathrm{T}\), how fast do electrons and ions drift?

    Show answer

    \(v_d = E/B = 4.0\times10^6\ \mathrm{m/s}\), the same for both.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz