Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random  

[parent] Electric Field of a Finite Charged Rod Example

(Example)

ED08E1: Electric Field of a Finite Charged Rod - Complete Component Integrals and Trigonometric Substitution

This worked companion expands the first finite-rod example from ED08. We will calculate both Cartesian components of the electric field from Coulomb’s law. In particular, we will not set the vertical component equal to zero by invoking an odd-function argument. Instead, we will integrate it, evaluate its antiderivative at both endpoints, and see the cancellation emerge as an actual calculation.

We will also derive the antiderivatives with a trigonometric substitution, rather than simply announcing a formula from an integration table. The goal is to learn a repeatable method for continuous-source electrostatics.

1 Problem statement and coordinate system

A straight rod of uniform line charge density λ extends along the z axis from z = −L to z = +L, where L > 0. The rod’s total length is 2L and its total charge is

Q =  λ(2L ).
(1)

We want the electric field at a point on the perpendicular bisector, a distance s > 0 to the right of the midpoint:

r = sˆx.
(2)

We use Cartesian coordinates with z pointing upward. The charge density λ is a signed quantity; it may be positive or negative.

PIC

Figure 1. The finite charged rod occupies the z axis from −L to +L. A source element at height η contributes along the displacement R toward the observation point at sx. For positive charge at η > 0, that contribution has positive x and negative z components.

What we must find

The answer is a vector, not just a magnitude:

E(s) = Ex (s)xˆ+  Ez(s)ˆz.
(3)

There is no y component because every source element, the rod, and the observation point lie in the xz plane. However, the value of Ez is still to be established by integration.

2 What is a source coordinate, and why introduce η?

In ED08 the position of a source element was written z′ (“z prime”). To make this calculation easier to read we rename that integration coordinate η (Greek eta). It describes where on the rod the little charge element is located. It is not the observation coordinate.

At a given source height η,

rsource = ηˆz,    − L ≤  η ≤ L.
(4)

The infinitesimal length of the rod is dη, so its charge is

dq = λ dη.
(5)

units confirm this: λ has units C∕m and dη has units m, so dq has units of coulombs.

3 Construct the source-to-field displacement carefully

Coulomb’s law must use the vector pointing from the source element to the observation point. It is the observation position minus the source position:

R  = r − rsource.
(6)

Substitute the two vectors:

R  = sˆx − ηˆz.
(7)

The minus sign before η is essential. If the source lies above the midpoint (η > 0), the displacement from that source toward the observation point is directed downward in z.

Because x and z are perpendicular,

R2 = R  ⋅ R = s2 + η2.
(8)

Hence

    ∘  -2----2
R =    s + η
(9)

and the unit vector toward the observation point is

      sˆx − ηˆz
ˆR  = ∘---2---2-.
        s + η
(10)

4 Build the differential electric-field vector

The electric field of a small source charge dq is

        1   dq
dE  =  ------2Rˆ.
       4π𝜖0R
(11)

We substitute the unit vector to express the same law in a more useful form:

dE =  -1--dq-R-.
      4π𝜖0 R3
(12)

Using dq = λdη, Equation (7), and R3 = (s2 + η2)3∕2,

dE =  -λ----s-ˆx −-ηˆz--d η.
      4π𝜖0 (s2 + η2)3∕2
(13)

This is the central setup equation. It contains both components, their signs, and the same distance-dependent denominator.

To find the total field, add contributions from every source element:

     ∫ L
E  =     dE.
      − L
(14)

Because Cartesian unit vectors do not depend on the source coordinate η, we can integrate their scalar coefficients independently.

5 Separate the two component integrals explicitly

Reading off the coefficient of x in Equation (13) gives

       λs  ∫ L      dη
Ex =  -----    --2----2-3∕2-.
      4π𝜖0  −L (s  + η )
(15)

Reading off the coefficient of z gives

             ∫ L
Ez =  − -λ---    ----ηdη----.
        4π𝜖0  −L (s2 + η2)3∕2
(16)

Notice the differences:

  • Ex has a constant numerator s, because the horizontal distance from every source element to the observation point is the same.
  • Ez has the numerator −η, because the vertical displacement from a source element to the observation point changes with its height along the rod.
  • We will evaluate both definite integrals. Do not cancel Ez before performing its calculation.

PIC

Figure 2. Contributions to the field from one source element above the midpoint and one below it. The diagram helps check component directions, but the cancellation of Ez will be proved by explicitly evaluating the integral.

6 Why a trigonometric substitution is useful here

Both component integrals contain the same expression,

 2    2
s +  η .
(17)

Whenever we see a positive constant squared plus an integration variable squared beneath a square root, the substitution

η =  stan 𝜃
(18)

is worth trying. Here s > 0 is fixed as we integrate: it is the position of the observation point, not the integration variable.

The reason for this substitution is the trigonometric identity

1 + tan2 𝜃 = sec2𝜃.
(19)

It changes the troublesome sum of squares into a perfect square in trigonometric form.

PIC

Figure 3. The right triangle used for η = stan𝜃. Its adjacent side is s, its opposite side is η when η > 0, and its hypotenuse is ∘  2----2-
   s + η. Negative values of η correspond to negative values of 𝜃.

Step A: differentiate the substitution

Since

η = s tan𝜃,
(20)

and s is constant during integration,

dη-=  ssec2𝜃.
d𝜃
(21)

Therefore

dη = s sec2𝜃d 𝜃.
(22)

This equation is just as important as Equation (18); when changing integration variables we must change the differential as well.

Step B: simplify the denominator

Square Equation (18):

η2 = s2tan2 𝜃.
(23)

Add s2 to both sides:

s2 + η2 = s2 + s2tan2𝜃.
(24)

Factor out s2:

s2 + η2 = s2(1 + tan2 𝜃).
(25)

Apply the identity:

 2   2    2    2
s + η  = s  sec 𝜃.
(26)

Raise both sides to the 3∕2 Power. Since −π∕2 < 𝜃 < π∕2 and s > 0, sec 𝜃 is positive, so

  2    2 3∕2    3   3
(s  + η )   =  s sec 𝜃.
(27)

The positivity condition avoids silently dropping absolute-value signs during the square-root operation.

Step C: transform the integration limits

The original integral runs from η = −L to η = +L. Because

          (  )
𝜃 = arctan  η- ,
            s
(28)

we define

           (   )
             L
α = arctan   s-  .
(29)

Thus the lower endpoint becomes

η = − L    −→    𝜃 = − α,
(30)

and the upper endpoint becomes

η = +L     −→    𝜃 = + α.
(31)

Since L > 0 and s > 0, the angle α lies between 0 and π∕2.

Step D: record the triangle relations for later

From the triangle in Figure 3,

         L-
tan α =  s,
(32)

so the opposite side is L, the adjacent side is s, and the hypotenuse is  --------
√s2 + L2. Therefore

           L
sin α =  √--2----2,
         s  + L
(33)

cosα =  √---s----.
          s2 + L2
(34)

We will use these relations to translate our answers back into the original distances s and L.

7 Complete x-component integration, one algebraic step at a time

Start by rewriting Equation (15):

           ∫
      -λs--  L -----1------
Ex =  4π𝜖0     (s2 + η2 )3∕2 dη.
            −L
(35)

We replace dη with Equation (22), the denominator with Equation (27), and the limits with −α and +α:

           ∫ +α      2
Ex =  -λs--     -ssec-𝜃-d𝜃.
      4π𝜖0  −α  s3sec3 𝜃
(36)

Cancel powers of s in the fraction:

s-   1-
s3 = s2.
(37)

Cancel powers of sec 𝜃:

sec2𝜃-  --1--
sec3𝜃 = sec 𝜃.
(38)

Finally use 1∕ sec 𝜃 = cos 𝜃. The entire transformed integral becomes

      λs   1 ∫ +α
Ex =  ------      cos𝜃 d𝜃.
      4π𝜖0s2  −α
(39)

Simplify the constant multiplier s∕s2 = 1∕s:

            ∫ + α
E   = --λ---     cos 𝜃d𝜃.
  x   4π 𝜖0s  − α
(40)

The original radical has disappeared. This is the payoff of the substitution.

The antiderivative of cosine is sine:

∫

  cos 𝜃d𝜃 = sin 𝜃 + C.
(41)

Apply the fundamental theorem of calculus:

        λ
Ex  = ------[sin 𝜃]+−αα.
      4π 𝜖0s
(42)

Write out the upper value minus the lower value:

E  =  --λ---(sin α − sin (− α )).
 x    4π𝜖0s
(43)

Since sin(−α) = − sin α,

      --λ---
Ex  = 4π 𝜖 s (sinα + sin α).
          0
(44)

Collect the two equal terms:

E  =  -2-λ--sin α.
  x   4π𝜖0s
(45)

Finally insert Equation (33):

      -2λ------L------
Ex =  4π𝜖 s √s2-+-L2-.
         0
(46)

Thus

            λL
Ex =  -----√--2----2-.
      2π𝜖0s  s  + L
(47)

No antiderivative was guessed: we obtained the answer from the explicit variable change, simplified the transformed integral, evaluated its endpoints, and converted the trigonometric answer back to lengths.

8 Complete z-component integration instead of assuming cancellation

Now repeat the same process for the other component. It is important to keep its leading minus sign throughout.

The original expression is

         λ  ∫  L      η
Ez = − -----     --2---2-3∕2 d η.
       4 π𝜖0  −L (s + η )
(48)

We use the same substitution,

η = s tan𝜃,
(49)

with

dη = s sec2𝜃d 𝜃,
(50)

and

(s2 + η2)3∕2 = s3sec3𝜃.
(51)

The limits again become −α and +α. Substitute each item into the integral:

            ∫  +α              2
Ez = − --λ--      (s-tan𝜃-)(s-sec-𝜃)-d𝜃.
       4 π𝜖0  −α      s3sec3𝜃
(52)

In the numerator the two factors of s multiply to s2:

            ∫
       --λ--  + αs2-tan𝜃-sec2𝜃
Ez = − 4π 𝜖         s3sec3𝜃    d𝜃.
           0 − α
(53)

Cancel s2∕s3 = 1∕s and sec 2∕ sec 3 = 1∕ sec:

              ∫
          λ     +α tan 𝜃
Ez =  − 4π𝜖-s-     sec𝜃-d𝜃.
           0   −α
(54)

Recall the definitions

        sin𝜃               1
tan 𝜃 = -----,    sec𝜃 =  -----.
        cos𝜃              cos𝜃
(55)

Therefore

tan-𝜃 =  sin-𝜃∕cos-𝜃-= sin𝜃.
 sec𝜃     1∕ cos𝜃
(56)

The transformed integral is now elementary:

             ∫
         λ     + α
Ez = − ------     sin𝜃 d𝜃.
       4π 𝜖0s  − α
(57)

We find the antiderivative directly:

∫
  sin𝜃 d𝜃 = − cos 𝜃 + C.
(58)

Evaluate at the two limits:

E  =  − --λ---[−  cos𝜃]+α.
  z     4π𝜖0s         −α
(59)

An expression in square brackets evaluated between limits means upper value minus lower value. Writing out that subtraction,

          λ
Ez =  − ------[(− cos α) − (− cos(− α ))].
        4π𝜖0s
(60)

Remove the parentheses inside the brackets:

E  = − --λ---[− cos α + cos(− α )].
  z    4 π𝜖0s
(61)

Now use cos(−α) = cos α. The endpoint triangles have the same adjacent length s and the same hypotenuse √s2-+--L2-, so both cosines are s∕√s2-+-L2--:

          λ
Ez  = − ------[− cosα + cos α].
        4π 𝜖0s
(62)

The two endpoint terms are identical and cancel:

          λ
Ez =  − -----(0) = 0.
        4π𝜖0s
(63)

This is the explicit proof that the vertical component vanishes. We did not need to invoke an odd-function integration rule. Instead, the algebra of the definite integral produced equal endpoint contributions with opposite signs.

9 A second check of the z integral by direct differentiation

Although our primary method was trigonometric substitution, we can check its result using a simple derivative. Consider

          2    2− 1∕2
f (η) = (s + η )    .
(64)

Here s is still constant. Apply the chain rule:

df-= − 1-(s2 + η2)− 3∕2(2η).
dη     2
(65)

The factors of two cancel:

df-     -----η------
dη =  − (s2 + η2)3∕2.
(66)

Thus the integrand in Equation (48), including its leading minus sign, is a derivative:

           ∫ L    (           )
Ez  = --λ--    -d-  ∘---1-----  dη.
      4π 𝜖0 − Ld η     s2 + η2
(67)

The fundamental theorem of calculus gives

           [          ]L
        λ        1
Ez  = -----  ∘--2----2-   .
      4π 𝜖0    s +  η  − L
(68)

Substitute the upper endpoint η = L and lower endpoint η = −L explicitly:

           (                          )
      -λ---  ----1-----  ------1------
Ez =  4π𝜖    √ -2----2-− ∘ -2--------2   .
         0     s + L       s  + (− L)
(69)

Because (−L)2 = L2, the parenthesis is zero, confirming Equation (63).

This check also clarifies a general lesson: a zero definite integral does not require its integrand to be zero. Contributions along the rod can be nonzero but integrate to zero over the complete interval.

10 Assemble the electric-field vector

We started with

E = Ex ˆx + Ez ˆz.
(70)

The two explicit integrations produced

            λL
Ex =  -----√--2----2-,
      2π𝜖0s  s  + L
(71)

and

Ez =  0.
(72)

Therefore

E (s) = -----√λL------xˆ,     s > 0.
        2π𝜖0s  s2 + L2
(73)

This is exactly the finite-rod expression obtained in ED08 by a shorter symmetry argument, but we have now proved every component by integration.

For λ > 0 the field points in the +x direction. For λ < 0 the scalar coefficient is negative, and the field points toward the rod in the −x direction. We do not need a new formula for negative charge.

11 Four ways to check the answer

Check 1: units

The factor λ∕(𝜖0s) has units of electric field. The remaining factor

----L-----
√ -2----2-
  s +  L
(74)

is dimensionless, because its numerator and denominator are both lengths.

Check 2: infinite-line limit

Keep s and λ fixed while extending the endpoints without bound, L →∞. Write

    L             1
√--2----2-= ∘-----------2.
  s + L        1 + (s∕L )
(75)

As L →∞, the ratio s∕L → 0, so the bracket tends to one. Hence

            λ
E (s) − → -----ˆx.
          2π𝜖0s
(76)

This is the well-known infinite straight line-charge field at a point on its positive radial axis.

Check 3: distant rod behaves like a point charge

Far away from the finite rod, s ≫ L. Factor s out of the radical:

√ --------    ∘ -----------
  s2 + L2 =  s  1 + (L∕s)2,
(77)

where s > 0. The result becomes

E  =  -2λL--∘-----1------.
 x    4π𝜖0s2   1 + (L ∕s)2
(78)

Because L∕s is small, the last factor approaches one. Recognizing the total charge Q = 2λL,

E  ≃  --Q----    (s ≫ L ).
  x   4π𝜖0s2
(79)

The complete rod looks approximately like a point charge at large distances. This is also a direct connection to the monopole term of the multipole expansion in ED10.

Check 4: approach a long rod from nearby

If s ≪ L while s remains positive, then √ -2----2-
  s  + L ≃ L and

Ex ≃ ---λ--.
     2 π𝜖0s
(80)

This is the same functional behavior as the infinite line. Very close to the middle of a long rod, the finite ends have little influence.

12 Independent verification using electric potential

This section is optional for a first reading, but it provides an especially useful test because potential requires integrating a scalar kernel instead of vector components.

Choose V (∞) = 0. The potential from the rod is

          1  ∫ L    λd η
V (s) = -----    ∘--------.
        4π𝜖0  −L   s2 + η2
(81)

Apply our same substitution η = s tan 𝜃. The radical becomes

∘  -------
   s2 + η2 = s sec𝜃,
(82)

and the differential is dη = s sec 2𝜃 d𝜃. Thus

             ∫ α
        -λ---    ssec2-𝜃
V (s) = 4π𝜖0  −α s sec𝜃 d𝜃.
(83)

Cancel the factors to obtain

             ∫
          λ    α
V (s) = -----    sec𝜃 d𝜃.
        4π 𝜖0 − α
(84)

To derive the antiderivative of secant, multiply numerator and denominator by sec 𝜃 + tan 𝜃:

        sec𝜃(sec𝜃-+-tan-𝜃)
sec 𝜃 =    sec𝜃 + tan 𝜃   .
(85)

Expand the numerator:

sec𝜃(sec 𝜃 + tan 𝜃) = sec2𝜃 + sec𝜃 tan𝜃.
(86)

But

-d-                               2
d𝜃 (sec 𝜃 + tan 𝜃) = sec𝜃 tan 𝜃 + sec 𝜃.
(87)

This is the numerator exactly. Let u = sec 𝜃 + tan 𝜃; then du is the numerator times d𝜃. Hence

∫            ∫
                du-
   sec𝜃d 𝜃 =    u  = ln |u| + C.
(88)

Restoring the angle,

∫

   sec 𝜃d𝜃 =  ln |sec𝜃 + tan 𝜃| + C.
(89)

Evaluate from −α to +α:

               (              )
        --λ--    sec-α-+-tanα-
V (s) = 4π 𝜖0 ln sec α − tanα   .
(90)

Since sec 2α − tan 2α = 1, the denominator is the reciprocal of the numerator. Therefore

         2λ
V (s) = 4π𝜖--ln(sec α + tanα ).
           0
(91)

From the right triangle,

        √ --------
        --s2 +-L2-             L-
secα =      s    ,     tan α =  s .
(92)

Our potential is

               ( √ -2----2-   )
V (s) = -λ---ln   --s-+--L-+--L-  .
        2π𝜖0           s
(93)

An equivalent expression uses the inverse hyperbolic sine:

                   (  )
        --λ--       L-
V (s) = 2π 𝜖 asinh   s  .
            0
(94)

Because the potential depends only on s at the perpendicular-bisector observation point, the radial field there is Ex = −dV∕ds. To check it, set w = L∕s and use

d                 1          dw      L
---asinh(w ) = √------2,     --- = − -2.
dw               1 + w       ds      s
(95)

The chain rule gives

dV       λ         L
---=  − -------∘-----------.
ds      2π𝜖0 s2  1 + (L∕s)2
(96)

Since s > 0,

 ∘  -----------   √ --------
s2  1 + (L∕s)2 = s  s2 + L2.
(97)

Therefore

E  =  − dV-=  -----√λL-------,
  x     ds    2π 𝜖0s  s2 + L2
(98)

in complete agreement with Equation (73). This verifies the x component without assuming the formula from the original vector integral.

13 A numerical example

Suppose

L =  0.25 m,      s = 0.15 m,      λ = 4.0 nC ∕m.
(99)

The total rod length is 2L = 0.50 m, and the total charge is

Q  = 2λL  = 2.0 nC.
(100)

Substitute into the result with 1∕(4π𝜖0) ≃ 8.988 × 109 N m2∕C2:

      -1------2λL----
Ex =  4π𝜖0s √s2-+-L2-.
(101)

Calculate the denominator first:

 √ -2----2-        ∘ ------2--------2-  2
s  s +  L  = (0.15)  (0.15) + (0.25)  m  .
(102)

Compute the distance in the radical:

∘  -----2---------2-  √ -------
   (0.15)  + (0.25) =    0.0850  m ≈ 0.2915 m.
(103)

Hence

 √ --------
s  s2 + L2 ≈ 0.04373  m2.
(104)

The numerator is

2λL =  2(4.0 × 10 −9)(0.25 ) = 2.0 × 10− 9 C.
(105)

Therefore

                 9 2.0 ×-10−9-                2
Ex ≈  (8.988 ×  10 ) 0.04373   N ∕C ≈ 4.11 × 10  N ∕C.
(106)

The complete vector result is

              2
E ≈  (4.11 × 10  N ∕C )xˆ.
(107)

The z component remains exactly zero by the calculation above. The field magnitude is positive and points along +x because λ > 0.

14 Common mistakes and how to catch them

  • Using R = rsource − r. That points from the observation point toward the charge and reverses the signs in the field contribution. We need observation minus source.
  • Forgetting to transform dη. If η = s tan 𝜃, then dη = s sec 2𝜃 d𝜃. The substitution is incomplete without this factor.
  • Keeping the old limits after substituting. When changing variables to 𝜃, the limits become −α and +α.
  • Dropping the leading minus sign in Ez. The numerator of the z component is −η because R = sx − ηz.
  • Canceling Ez before evaluating its integral. Symmetry is a useful prediction, but the purpose of this worked example is to obtain zero by direct integration.
  • Confusing L with the total rod length. The rod extends from −L to L, so its total length is 2L.
  • Mistaking the finite-rod field for a point-charge law at every distance. The near-field and far-field distance dependences differ.

15 Short exercises for independent practice

  1. Repeat the z-component calculation when the limits are η = a and η = b, with −L ≤ a < b ≤ L. Do not assume the result is zero. Using the direct antiderivative, obtain
           λ  (     1           1    )
Ez = -----  √--------−  √--------  .
     4 π𝜖0    s2 + b2     s2 + a2
    (108)

  2. For the same limits a,b, use the trigonometric substitution to find the x component:
                (                     )
E  =  --λ---  √---b----−  √--a-----  .
  x   4π𝜖0s     s2 + b2    s2 + a2
    (109)

  3. Verify explicitly that the formulas above reduce to the main result when a = −L and b = L.
  4. With the total charge Q held fixed, let L → 0 and explain why the rod approaches a point charge, whereas holding λ fixed while L → 0 makes the total charge vanish.

16 Final perspective

The mathematical strategy is reusable:

  1. Identify source and observation positions.
  2. Form R = r − rsource with the correct signs.
  3. Write the vector Coulomb integrand before separating components.
  4. Keep all nonzero-looking components until they have been explicitly integrated.
  5. Choose a substitution that eliminates the radical; transform both the differential and the limits.
  6. Evaluate endpoint values carefully, then translate back to physical distances.
  7. Check units, charge signs, and limiting geometries.

The finite charged rod is a particularly good self-study problem because its algebra is simple enough to carry out completely, yet it introduces the same source-integral techniques used for rings, disks, cylinders, spheres, and more general charge distributions.

References

[1]   D. J. Griffiths, Introduction to Electrodynamics, 5th ed., Cambridge University Press, 2023.

[2]   E. M. Purcell and D. J. Morin, Electricity and Magnetism, 3rd ed., Cambridge University Press.


"Electric Field of a Finite Charged Rod Example" is owned by bloftin.
(view preamble)
View style:
Other names:  ED08E1
Keywords:  electrostatics, finite charged rod, Coulomb law, continuous line charge, electric field components, trigonometric substitution, self-study worked example, perpendicular bisector, symmetry verification, improper limit

This object's parent.

Cross-references: section, multipole expansion, negative charge, theorem, relations, operation, Power, identity, trigonometric identity, square, diagram, scalar, source charge, unit vector, vectors, units, position, magnitude, vector, positive charge, displacement, charge density, Cartesian coordinates, charge, line charge density, formula, trigonometric substitution, Coulomb's law, electric field, ED08

This is version 1 of Electric Field of a Finite Charged Rod Example, born on 2026-11-24.
Object id is 1596, canonical name is ElectricFieldOfAFiniteChargedRodExample.
Accessed 12 times total.

Classification:
Physics Classification: 41.20.Cv (Electrostatics; Poisson and Laplace equations, boundary-value)
 41.20.-q (Applied classical electromagnetism)
 03.50.De (Classical electromagnetism, Maxwell equations )

Pending Errata and Addenda

None.

Discussion

No messages.

Interact