Sub topic 12
Getting the field from the potential
Earlier chapters computed potential from charges and from the field. This chapter goes the other way: given V as a function of position, you recover the electric field E. You need the following to follow it:
- Potential and potential difference, including ΔV = -E·d for a uniform field.
- Equipotential surfaces.
- Single-variable derivatives, plus partial derivatives for the multi-variable parts.
The integral relation and its inverse
Potential difference is defined by the work per unit charge done against the field. Moving from point a to point b:
V(b) - V(a) = -∫ E · dl, integrated along any path from a to b.
The path does not matter, because the electrostatic force is conservative. Take a very short step dl along the x direction. Then dV = -E_x dx, so:
E_x = -dV/dx
The field component along a direction is the negative rate of change of potential along that direction. The units agree: a volt per metre is a newton per coulomb.
For a potential that depends on all three coordinates, each component uses a partial derivative. The other coordinates are held fixed:
- E_x = -∂V/∂x
- E_y = -∂V/∂y
- E_z = -∂V/∂z
Together these form E = -∇V, where ∇V is the gradient of V. The gradient is a vector that points in the direction in which V increases fastest. Its magnitude is the steepness of V in that direction.
Reading the minus sign
The minus sign carries physical meaning: E points toward decreasing V, the "downhill" direction. A positive charge feels a force along E, so it moves toward lower potential and lower potential energy. A negative charge moves toward higher potential.
The magnitude of E is the slope of V. Where V changes quickly over a short distance, the field is strong. Where V is nearly flat, the field is weak.
Adding a constant to V changes nothing, because the derivative of a constant is zero. This is why the choice of V = 0 reference never affects the field. Only differences in V matter.
Worked examples
A point charge
For a point charge q, V = kq/r. In the radial direction:
E_r = -dV/dr = -d(kq/r)/dr = kq/r²
This is Coulomb's field. A positive q gives a positive E_r, which points outward. The calculus reproduces the law you started from.
A uniform field
Suppose V(x) = -E₀x, where E₀ is a constant. Then E_x = -dV/dx = E₀. A straight-line potential means a uniform field. Its slope is the field strength, and this is the differential form of ΔV = -E·d.
A two-variable potential
Let V(x, y) = 3x² - 2xy, in volts, with x and y in metres. Differentiate with respect to each coordinate:
- E_x = -∂V/∂x = -(6x - 2y)
- E_y = -∂V/∂y = 2x
At the point (1 m, 2 m):
- E_x = -(6 - 4) = -2 V/m
- E_y = 2 V/m
The magnitude is √(4 + 4) ≈ 2.83 V/m, directed at 135° from the +x axis.
Connection to equipotentials
On an equipotential surface V is constant, so the derivative of V along any direction lying in the surface is zero. Therefore E has no component along the surface. The field is perpendicular to equipotentials everywhere.
Two further facts follow from the gradient:
- E points from higher-V surfaces toward lower-V surfaces.
- If you draw equipotentials at equal voltage steps, the field is strongest where the surfaces are closest together. The spacing Δl between neighbouring surfaces with step ΔV gives E ≈ ΔV/Δl.
| Feature of the V map | What it tells you about E |
|---|---|
| Surfaces tightly spaced | Strong field |
| Surfaces widely spaced | Weak field |
| Constant V over a region | E = 0 there |
| Direction of steepest decrease | Direction of E |
| Along an equipotential | E component is zero |
Computing E numerically from V
Often V is known only as a function you can evaluate, such as a sum over many charges. A central difference estimates the derivative from two nearby values: dV/dx ≈ [V(x+h) - V(x-h)] / (2h). The code below applies it to the dipole from the previous chapters and compares the result with the exact field built from Coulomb's law.
from math import hypot
K = 8.9875517923e9 # N m^2 / C^2
def potential(charges, x, y):
"""Electric potential in volts at (x, y) from a list of (q, qx, qy)."""
return sum(K * q / hypot(x - qx, y - qy) for q, qx, qy in charges)
def field_from_potential(charges, x, y, h=1e-6):
"""E = -grad V, using central differences with step h (metres)."""
ex = -(potential(charges, x + h, y) - potential(charges, x - h, y)) / (2 * h)
ey = -(potential(charges, x, y + h) - potential(charges, x, y - h)) / (2 * h)
return ex, ey
def field_exact(charges, x, y):
"""Field summed directly from Coulomb's law, for comparison."""
ex = ey = 0.0
for q, qx, qy in charges:
dx, dy = x - qx, y - qy
r = hypot(dx, dy)
ex += K * q * dx / r**3
ey += K * q * dy / r**3
return ex, ey
source = [(1e-9, -0.05, 0.0), (-1e-9, 0.05, 0.0)]
print(potential(source, 0.0, 0.1)) # about 0 V on the midplane
print(field_from_potential(source, 0.0, 0.1)) # about (643, 0) N/C
print(field_exact(source, 0.0, 0.1)) # about (643, 0) N/CThe potential on the midplane is zero, yet the field there is about 643 N/C pointing along +x, from the positive charge toward the negative one. The potential is zero at that point, but it changes rapidly as you move in the x direction. The field depends on how V changes nearby, not on the value of V at the point.
Common errors and edge cases
- Dropping the minus sign. If you compute +dV/dx you get the field pointing the wrong way. Check the result: E should point toward lower V.
- Differentiating along the wrong variable. For V(r) of a point charge, the derivative gives the radial component. To get Cartesian components you must multiply by x/r, y/r, and z/r.
- Using a single value of V. You cannot get E from V at one point. You need V in a small neighbourhood, or an analytic formula.
- Choosing h badly in numerical work. If h is too large, the difference averages over a region where V curves. If h is too small, floating-point rounding dominates, because you subtract two nearly equal numbers. A step of 10⁻⁶ m for sub-metre distances is a reasonable start.
- Singular points. Near a point charge, V diverges and the derivative is unreliable. Stay away from the charge positions.
- Electrostatics only. E = -∇V holds when E is conservative. With changing magnetic fields, the induced E field has no single-valued potential.
- Discontinuities. At an ideal surface layer of charge, V is continuous but its slope jumps, so the normal component of E jumps. V itself never jumps in a real finite-charge situation.
Where this leads
The relation lets you work with the scalar V and still get the vector E. For a continuous distribution or a dipole, summing scalars is easier than summing vectors. You compute V first and differentiate afterwards. It also explains conductors: a conductor in equilibrium has E = 0 inside, so V has zero slope everywhere there and the conductor is one equipotential.
Exercise
A potential is V(x, y) = 4xy + 2y² volts, with x and y in metres. Find the field components Ex and Ey at the point (2 m, 1 m), and state the magnitude of E.
Show answer
Ex = -∂V/∂x = -4y = -4 V/m at y = 1. Ey = -∂V/∂y = -(4x + 4y) = -(8 + 4) = -12 V/m. The magnitude is √(16 + 144) = √160 ≈ 12.6 V/m, and the field points mostly toward -y.
Exercise
Along the x axis, a potential is V = 50 V for x < 0 and falls linearly to 20 V at x = 0.30 m, then stays at 20 V for x > 0.30 m. Find E_x in each of the three regions.
Show answer
For x < 0, V is constant, so Ex = 0. Between 0 and 0.30 m, the slope is (20 - 50)/0.30 = -100 V/m, so Ex = -(-100) = +100 V/m, pointing toward +x (toward lower V). For x > 0.30 m, V is constant again, so E_x = 0.