Sub topic 7
Adding fields from several charges
This chapter assumes you can add vectors by components and find magnitudes and angles with trigonometry. It also assumes you know the field of one point charge, E = kq/r², and Coulomb's law. Here you learn to combine fields from several charges at one point.
The principle: fields add as vectors
Coulomb's law gives the force between two point charges. Experiments show that when a third charge is added, the force between the first two does not change. The net force on any one charge is the vector sum of the forces from each of the others taken alone. This is the superposition principle.
Dividing a force by the test charge turns it into a field. Superposition therefore carries over directly. For source charges q₁, q₂, ..., qₙ, the net field at a point P is
E_net = E₁ + E₂ + ... + Eₙ
Each Eᵢ is the field that charge qᵢ would produce if it were the only charge present. The other charges do not change it. This independence is what makes the method work.
Two facts follow from this. The field is a vector, so you must add components rather than magnitudes. The field at P also exists whether or not a charge sits at P. If you later place a charge q at P, the force on it is F = qE_net. The charge q does not count among the sources, because a charge exerts no net force on itself.
The field of one source, written as a vector
The magnitude of the field of a point charge is kq/r². To add fields you also need the direction. The vector form is
Eᵢ = k qᵢ r̂ᵢ / rᵢ²
Here rᵢ is the distance from source i to the field point P. The unit vector r̂ᵢ points from the source to P. It is defined this way for both signs of charge. The sign of qᵢ then decides the direction:
- If qᵢ is positive, Eᵢ points away from the source, along r̂ᵢ.
- If qᵢ is negative, Eᵢ points toward the source, opposite to r̂ᵢ.
In components, let source i sit at (xᵢ, yᵢ) and let P be at (px, py). Define dx = px − xᵢ and dy = py − yᵢ, and let r = √(dx² + dy²). Then
- Eᵢₓ = k qᵢ dx / r³
- Eᵢᵧ = k qᵢ dy / r³
The r³ comes from the 1/r² magnitude times the unit-vector components dx/r and dy/r. Keeping the signed charge qᵢ in the formula handles attraction and repulsion automatically. You do not need to use absolute values and then fix the directions by hand.
A procedure that works every time
Before you calculate, sketch the situation and draw a rough arrow for each source's field at P. This sketch gives you a way to check the final signs. If your arrows point up and to the right and your answer points down and left, something is wrong.
Worked example: two equal charges
Place a +2.0 nC charge at (−4.0 cm, 0) and another +2.0 nC charge at (+4.0 cm, 0). Find the field at P = (0, 3.0 cm).
Each source is at distance r = √(4² + 3²) = 5.0 cm from P. Each has the same magnitude:
E = kq/r² = (8.99 × 10⁹)(2.0 × 10⁻⁹) / (0.050)² ≈ 7.19 × 10³ N/C
Both charges are positive, so each field points away from its source. The field from the left charge points up and to the right. The field from the right charge points up and to the left.
- The x components have equal size and opposite sign, so they cancel: Eₓ = 0.
- The y components each equal E × (3/5) ≈ 4.31 × 10³ N/C, and both point up.
The net field is therefore about 8.63 × 10³ N/C in the +y direction. If you had added the two magnitudes directly, you would have gotten 14.4 × 10³ N/C, which is wrong. Adding magnitudes ignores the directions.
The symmetry here is a useful shortcut. When sources are placed symmetrically about P, some components cancel exactly. Look for such cancellations before doing any arithmetic.
Computing it in code
The function below implements the component formulas for any number of point charges. Each charge is given as a tuple of its signed charge and its position.
import math
K = 8.9875517923e9 # N*m^2/C^2
def field_at(point, charges):
"""Net electric field (Ex, Ey) in N/C at point from a list of (q, (x, y)) point charges."""
px, py = point
ex = ey = 0.0
for q, (x, y) in charges:
dx, dy = px - x, py - y
r = math.hypot(dx, dy)
e = K * q / r**2
ex += e * dx / r
ey += e * dy / r
return ex, ey
# A +1 nC and a -1 nC charge, 2 cm apart; evaluate the field at their midpoint.
charges = [(1e-9, (-0.01, 0.0)), (-1e-9, (0.01, 0.0))]
print(field_at((0.0, 0.0), charges)) # about (179751.0, 0.0) N/C
# The worked example above: two +2 nC charges, field at (0, 3 cm).
pair = [(2e-9, (-0.04, 0.0)), (2e-9, (0.04, 0.0))]
print(field_at((0.0, 0.03), pair)) # about (0.0, 8628.0) N/CLook at the first test. Both fields at the midpoint point in the +x direction. The positive charge is on the left and pushes the field to the right. The negative charge is on the right and pulls the field toward itself, which is also to the right. The two contributions of about 8.99 × 10⁴ N/C each add to about 1.80 × 10⁵ N/C. This is the field between the two charges of a dipole, which is strong because both sources contribute in the same direction.
The sign handling in field_at is worth studying. The code uses dx and dy, which point from source to P, and multiplies by the signed charge. A negative q makes e negative, which flips the direction. Nothing in the function branches on the sign of the charge.
Using the field to get a force
Once you have Enet at a point, the force on a charge q placed there is F = qEnet. For a negative q, the force is opposite to the field. With the code above, you can compute a force like this:
q_test = -3e-9 # a negative charge placed at the field point
ex, ey = field_at((0.0, 0.03), [(2e-9, (-0.04, 0.0)), (2e-9, (0.04, 0.0))])
fx, fy = q_test * ex, q_test * ey
print(fx, fy) # about (0.0, -2.59e-05) N: pulled back toward the sources' lineThis gives the same result as summing Coulomb forces on q one source at a time. The field method is better when you want the answer at many points, or for several different test charges. You compute the field once and reuse it.
Where the net field can be zero
A common question is where the net field vanishes. The answer depends on the signs of the charges.
- Two like charges. The fields oppose each other only between the charges. The zero lies between them, closer to the smaller charge.
- Two unlike charges. The fields point the same way between the charges, so no zero lies there. A zero can occur outside the pair, on the line through them, on the side nearer the smaller charge.
- Equal like charges. The zero sits at the midpoint.
For two like charges, q₁ and q₂, separated by L, with the zero at distance x from q₁, set the magnitudes equal: q₁/x² = q₂/(L − x)². Solve for x. You can take square roots here because both distances are positive. Taking the root of both sides gives √q₁ (L − x) = √q₂ x.
A zero of the field is not a point of stable equilibrium for a free charge in general. It tells you only that the net force on a charge placed there is zero. Whether that charge returns after a small nudge is a separate question.
Common errors
| Error | Why it fails | Fix |
|---|---|---|
| Adding magnitudes of the fields | Fields are vectors, so directions matter | Add x and y components separately |
| Using the distance from the origin | The formula needs the distance from each source to P | Compute dx, dy, r for each source |
| Pointing the field toward a positive source | Field direction is away from positive charges | Check the sign of q against the direction |
| Including the test charge as a source | The field at P comes from the other charges | List only source charges |
| Mixing units | Centimeters and nanocoulombs give wrong powers of ten | Convert to meters and coulombs first |
| Using the angle from the wrong axis | Sine and cosine swap | Use dx/r and dy/r, not angles, in code |
| Rounding midway | Small cancellations lose precision | Keep full precision until the last step |
Edge cases
- Field at a source's own position. The formula divides by r² with r = 0, so the field of a point charge is undefined at the charge itself. Code should not evaluate the field at a source location. A guard that raises an error is better than returning a silent infinity or NaN.
- Collinear charges. All sources and P lie on one line, so every field lies along that line. You can treat the problem in one dimension, with signs for direction. Choose +x as positive and give each field a sign by whether it points toward +x or −x.
- A large number of charges. The loop in
field_atruns in time proportional to the number of sources. For thousands of charges it is still fine. For a continuous charge distribution, the sum becomes an integral, which a later chapter develops. - Charges at different distances by orders of magnitude. The nearest source usually dominates, because the field falls as 1/r². A far source with a large charge can still matter, so check magnitudes rather than assuming.
Summary of the method
Superposition lets you treat each charge separately and add the results. The field at P from charge i is k qᵢ (P − rᵢ)/|P − rᵢ|³. The net field is the sum over sources, done component by component. The force on a charge q at P is qE_net. Use symmetry to cancel components when you can, and use code to check or extend the arithmetic.
Exercise
A +3.0 nC charge sits at (0, 0) and a −3.0 nC charge sits at (6.0 cm, 0). Find the net electric field at the midpoint (3.0 cm, 0), giving magnitude and direction.
Show answer
Each charge is 3.0 cm = 0.030 m from the midpoint, so each field has magnitude kq/r² = (8.99e9)(3.0e-9)/(0.030)² ≈ 3.0e4 N/C. The +3.0 nC charge pushes the field away from itself, toward +x. The −3.0 nC charge pulls the field toward itself, which is also toward +x. The fields point the same way, so they add: E ≈ 6.0e4 N/C in the +x direction.
Exercise
A +4q charge and a +q charge are separated by a distance L. At what point on the line between them is the net electric field zero?
Show answer
Let x be the distance from the +4q charge. The fields point in opposite directions between two like charges, so set the magnitudes equal: 4q/x² = q/(L − x)². Taking square roots gives 2(L − x) = x, so x = 2L/3. The field is zero at a distance 2L/3 from the +4q charge, which is L/3 from the +q charge. The point lies closer to the smaller charge, as expected.