Type to search, in English or Thai

  1. Home
  2. Lessons in English
  3. Electromagnetics (in Thai)
  4. 3D vectors for EM

// Lesson 29.2 · Electromagnetics through integrals ②

3D Vectors and Coordinate Systems for Electromagnetics: the Part Textbooks Rush Through

Ask students what confuses them most in electromagnetics and the answer is rarely Maxwell's equations. It is the first few lines of every problem: R=r−r′\mathbf R = \mathbf r - \mathbf r', R^\hat{\mathbf R}, aρ\mathbf a_\rho, ρ dϕ\rho\,d\phi, which most books pass over in a sentence. This page has one job: make those symbols readable and visible, with labs you can turn around in 3D, and finish with a five-step recipe that sets up every field integral in the lessons that follow.

By Ajarn ModUpdated
The 30-second version
  • r′\mathbf r' = where the source is (a piece of charge or current) · r\mathbf r = where you want the field · R=r−r′\mathbf R = \mathbf r - \mathbf r' points from source to field point
  • ∣R∣=Δx2+Δy2+Δz2|\mathbf R| = \sqrt{\Delta x^2 + \Delta y^2 + \Delta z^2} · R^=R/∣R∣\hat{\mathbf R} = \mathbf R/|\mathbf R| · point charge: E=kq R^/R2=kq R/R3\mathbf E = kq\,\hat{\mathbf R}/R^2 = kq\,\mathbf R/R^3
  • Cylindrical dV=ρ dρ dϕ dzdV = \rho\,d\rho\,d\phi\,dz · spherical dV=r2sin⁡θ dr dθ dϕdV = r^2\sin\theta\,dr\,d\theta\,d\phi · a curved edge is “radius × angle”
  • aρ,aϕ,ar,aθ\mathbf a_\rho, \mathbf a_\phi, \mathbf a_r, \mathbf a_\theta change direction from point to point: convert to x, y, z before integrating a vector
Try first: hide every worked solution, then reveal one step at a time

Why electromagnetics needs vectors in three dimensions Basic

In the previous lesson (29.1, in Thai) everything we added up was a scalar. Charges add, resistances in series add. Electric and magnetic fields, however, have a size and a direction. Two pieces of charge can produce fields of the same size pointing different ways, so the total is not the sum of the sizes. That is why every Physics 2 textbook has a vector appendix, and why an engineering electromagnetics course opens with Vector Analysis and Coordinate Systems.

The good news is that the toolkit is small: subtracting vectors, magnitude, unit vectors, dot, cross and three coordinate systems. Notation differs between books, so here is a translation table.

MeaningPhysics 2 (Serway, Halliday)Hayt & Buck / SadikuThis page
Radial unit vectorr^\hat{\mathbf r}ar\mathbf a_r or aR\mathbf a_RR^\hat{\mathbf R} (from the source) · ar\mathbf a_r (spherical)
Distance from the z axisrrρ\rhoρ\rho here · rr in physics problems
Charge per length / area / volumeλ, σ, ρ\lambda,\ \sigma,\ \rhoρL, ρS, ρv\rho_L,\ \rho_S,\ \rho_vλ, σ, ρv\lambda,\ \sigma,\ \rho_v
Directed area elementdAd\mathbf AdSd\mathbf Sboth
Watch the letter ρ: in Hayt, ρ is both the distance from the z axis and the charge density (ρ_v). The subscript tells them apart, so always read it. This page writes ρv\rho_v for density to avoid the clash.

Source point and field point: r′, r and R = r − r′ Basic

Every field problem has two kinds of point. The source point is where the charge or current sits; its position vector is r′\mathbf r'. The field point is where we want to know the field; its position vector is r\mathbf r. Both are measured from the same origin O.

The field does not care where either point is on its own. It cares about the distance and direction from the source to the field point. Follow the arrows: going from O to the charge (r′\mathbf r') and then on to P (R\mathbf R) must land you in the same place as going from O to P directly (r\mathbf r). So r′+R=r\mathbf r' + \mathbf R = \mathbf r, or

V1 Distance vector from the source to the field point

R=r−r′=(x−x′) ax+(y−y′) ay+(z−z′) az\mathbf R = \mathbf r - \mathbf r' = (x - x')\,\mathbf a_x + (y - y')\,\mathbf a_y + (z - z')\,\mathbf a_z

V2 Magnitude and unit vector

R=∣R∣=Δx2+Δy2+Δz2,R^=RRR = |\mathbf R| = \sqrt{\Delta x^2 + \Delta y^2 + \Delta z^2},\qquad \hat{\mathbf R} = \frac{\mathbf R}{R}

V3 Point-charge field, vector form

E=kqR2 R^=kq (r−r′)∣r−r′∣3\mathbf E = \frac{kq}{R^2}\,\hat{\mathbf R} = \frac{kq\,(\mathbf r - \mathbf r')}{|\mathbf r - \mathbf r'|^3}
xyzr′r+P(field point)q (source)R = r − r′OExample V1Charge at r′ = (1, 2, −1)Field point r = (3, −1, 5)R = (3−1, −1−2, 5−(−1)) = (2, −3, 6)|R| = √(4 + 9 + 36) = 7R̂ = (2, −3, 6)/7Always points from q to P

The right-hand form of V3 has R3R^3 underneath, which surprises people: isn't Coulomb's law an inverse square? It still is. The numerator R\mathbf R carries one factor of R; dividing it out leaves R^/R2\hat{\mathbf R}/R^2. The R/R3\mathbf R/R^3 form is handier for components because you never compute the unit vector separately.

Example V-1 · line by line, the way EM books do it

A 5 nC charge sits at (1, 2, −1) m. Find E\mathbf E at P(3, −1, 5) m.

  1. Write both positions: r′=(1,2,−1)\mathbf r' = (1, 2, -1), r=(3,−1,5)\mathbf r = (3, -1, 5)

  2. Subtract “end − start”, component by component (V1)

    R=(3−1, −1−2, 5−(−1))=(2, −3, 6)\mathbf R = (3-1,\ -1-2,\ 5-(-1)) = (2,\ -3,\ 6)
  3. Magnitude (V2): R=4+9+36=49=7R = \sqrt{4 + 9 + 36} = \sqrt{49} = 7 m · direction R^=17(2,−3,6)\hat{\mathbf R} = \tfrac17(2, -3, 6)

  4. Field size kq/R2=(8.99×109)(5×10−9)49=0.9173kq/R^2 = \dfrac{(8.99\times10^9)(5\times10^{-9})}{49} = 0.9173 N/C, then multiply by the direction

    E=0.9173⋅17(2,−3,6)=(0.262, −0.393, 0.786) N/C\mathbf E = 0.9173\cdot\tfrac17(2, -3, 6) = (0.262,\ -0.393,\ 0.786)\ \mathrm{N/C}

E≈0.262 ax−0.393 ay+0.786 az\mathbf E \approx 0.262\,\mathbf a_x - 0.393\,\mathbf a_y + 0.786\,\mathbf a_z N/C · check: 0.2622+0.3932+0.7862=0.917\sqrt{0.262^2 + 0.393^2 + 0.786^2} = 0.917 ✓

Subtract the wrong way round and you get r′−r\mathbf r' - \mathbf r, which points the other way: the field of a positive charge would point into it, which is wrong. Memory aid: R is born at the source and ends at the point you asked about, like light travelling from a lamp to your eye.

3D lab: move the charge and the point P, watch R change

The starting values are Example V-1. The three dashed segments are the components ΔX, ΔY, ΔZ laid end to end from the charge to P, as if you walked along one axis at a time. Drag the picture to rotate it, and use the xy, xz and yz buttons to look straight down each plane and see which component disappears.

Try three things. (1) Move the charge to the origin: now R=r\mathbf R = \mathbf r, the only case where the high-school formula applies directly. (2) Make q negative: the E arrow flips but R does not, because R is pure geometry. (3) Put P twice as far away: E drops to a quarter.

Dot and cross: what each one does in a field integral Basic

The whole topic uses just two vector products, and each has a clear job.

V4 Dot product = how much is along

A⋅B=ABcos⁡θ=AxBx+AyBy+AzBz\mathbf A\cdot\mathbf B = AB\cos\theta = A_xB_x + A_yB_y + A_zB_z

V5 Cross product = perpendicular, right-hand

∣A×B∣=ABsin⁡θ,ax×ay=az|\mathbf A\times\mathbf B| = AB\sin\theta,\quad \mathbf a_x\times\mathbf a_y = \mathbf a_z

Use the dot when the question is “how much goes through” or “how much along”. Flux E⋅dA\mathbf E\cdot d\mathbf A asks how much field pierces a surface (Gauss's law, 29.4, in Thai). Work and voltage E⋅dl\mathbf E\cdot d\mathbf l ask how much the field helps or opposes a walk along a path (29.5). The result is a scalar, so the pieces simply add.

Use the cross with currents and magnetic fields. The field of a current element I dl×R^I\,d\mathbf l\times\hat{\mathbf R} (Biot–Savart, 29.6) and the force on a wire I dl×BI\,d\mathbf l\times\mathbf B (29.10). The result is perpendicular to both factors, so you must picture three dimensions.

Three coordinate systems: Cartesian, cylindrical, spherical Intermediate

The same point in space can be described in several ways, like giving a house address by street number or by GPS. The best coordinates are the ones that make the boundary of the object a constant. A cylinder of radius a is x2+y2=a2x^2 + y^2 = a^2 in Cartesian coordinates but simply ρ=a\rho = a in cylindrical ones, and the limits of the integral become much simpler.

Cartesian (x, y, z)boxes · sheets · straight linesxyza_xa_ya_zCylindrical (ρ, φ, z)wires · coax · solenoidsxyzρa_ρa_φa_zSpherical (r, θ, φ)point charges · spheres · shellsxyzrθa_ra_θa_φ

V6 Cylindrical ↔ Cartesian (ρ,ϕ,z)(\rho, \phi, z): ρ = distance from the z axis, φ measured from +x

x=ρcos⁡ϕ,y=ρsin⁡ϕ,z=z,ρ=x2+y2x = \rho\cos\phi,\quad y = \rho\sin\phi,\quad z = z,\qquad \rho = \sqrt{x^2+y^2}

V7 Spherical ↔ Cartesian (r,θ,ϕ)(r, \theta, \phi): θ measured from +z (0 to π)

x=rsin⁡θcos⁡ϕ,  y=rsin⁡θsin⁡ϕ,  z=rcos⁡θ,r=x2+y2+z2x = r\sin\theta\cos\phi,\ \ y = r\sin\theta\sin\phi,\ \ z = r\cos\theta,\qquad r = \sqrt{x^2+y^2+z^2}

V8 Cylindrical unit vectors in terms of ax,ay\mathbf a_x, \mathbf a_y (they depend on the φ of the point)

aρ=cos⁡ϕ ax+sin⁡ϕ ay,aϕ=−sin⁡ϕ ax+cos⁡ϕ ay,az=az\mathbf a_\rho = \cos\phi\,\mathbf a_x + \sin\phi\,\mathbf a_y,\qquad \mathbf a_\phi = -\sin\phi\,\mathbf a_x + \cos\phi\,\mathbf a_y,\qquad \mathbf a_z = \mathbf a_z

V9 Spherical unit vectors

ar=(sin⁡θcos⁡ϕ, sin⁡θsin⁡ϕ, cos⁡θ),aθ=(cos⁡θcos⁡ϕ, cos⁡θsin⁡ϕ, −sin⁡θ),aϕ=(−sin⁡ϕ, cos⁡ϕ, 0)\mathbf a_r = (\sin\theta\cos\phi,\ \sin\theta\sin\phi,\ \cos\theta),\quad \mathbf a_\theta = (\cos\theta\cos\phi,\ \cos\theta\sin\phi,\ -\sin\theta),\quad \mathbf a_\phi = (-\sin\phi,\ \cos\phi,\ 0)

Mind the angle θ: in mathematical and physical spherical coordinates θ is measured down from the z axis (the equator is θ = 90°), not up from the ground like a geographic elevation angle. Get it wrong and sin and cos swap throughout the problem.

Example V-2 · converting both ways

(a) Where is ρ=4, ϕ=120∘, z=3\rho = 4,\ \phi = 120^\circ,\ z = 3 in Cartesian coordinates? (b) Give (2, 2, 1) in spherical coordinates.

  1. (a) V6: x=4cos⁡120∘=−2x = 4\cos120^\circ = -2, y=4sin⁡120∘=23≈3.464y = 4\sin120^\circ = 2\sqrt3 \approx 3.464, z=3z = 3

  2. (b) V7: r=4+4+1=3r = \sqrt{4+4+1} = 3 · θ=cos⁡−1(z/r)=cos⁡−1(1/3)≈70.53∘\theta = \cos^{-1}(z/r) = \cos^{-1}(1/3) \approx 70.53^\circ · ϕ=tan⁡−1(2/2)=45∘\phi = \tan^{-1}(2/2) = 45^\circ

  3. Check (b): 3sin⁡70.53∘cos⁡45∘=3(0.9428)(0.7071)=2.0003\sin70.53^\circ\cos45^\circ = 3(0.9428)(0.7071) = 2.000 ✓

(a) (−2, 3.464, 3)(-2,\ 3.464,\ 3) · (b) (3, 70.53∘, 45∘)(3,\ 70.53^\circ,\ 45^\circ) · always use atan2 for φ, because a plain tan⁡−1\tan^{-1} cannot tell the first quadrant from the third

The biggest trap: curvilinear unit vectors are not constant

ax\mathbf a_x points the same way wherever you stand. aρ\mathbf a_\rho points “away from the z axis”, which depends on your angle φ: at φ = 0 it points along +x, at φ = 180° along −x. If you add the fields of all the pieces of a ring by writing each as “size × aρ\mathbf a_\rho” and then pull aρ\mathbf a_\rho out of the integral, the answer is wrong at once.

Example V-3 · why you convert to x, y, z first

Evaluate ∫02πaρ dϕ\displaystyle\int_0^{2\pi}\mathbf a_\rho\,d\phi

  1. The common wrong answer: “aρ\mathbf a_\rho is a unit vector, take it out” → 2π aρ2\pi\,\mathbf a_\rho ✗

  2. Correct: convert with V8 first

    ∫02π(cos⁡ϕ ax+sin⁡ϕ ay)dϕ=[sin⁡ϕ]02πax+[−cos⁡ϕ]02πay=0\int_0^{2\pi}\big(\cos\phi\,\mathbf a_x + \sin\phi\,\mathbf a_y\big)d\phi = \big[\sin\phi\big]_0^{2\pi}\mathbf a_x + \big[-\cos\phi\big]_0^{2\pi}\mathbf a_y = \mathbf 0

0\mathbf 0 · arrows pointing outward all round the circle cancel completely. This is the mathematical reason the field of a ring on its axis has no transverse part (lesson 29.3)

See it in the lab: choose cylindrical coordinates and drag the angle φ. The arrows aρ\mathbf a_\rho (blue) and aϕ\mathbf a_\phi (green) turn with the point P, yet stay perpendicular to each other everywhere, while az\mathbf a_z never moves.

Length, area and volume elements: where ρ and r² sin θ come from Intermediate

In Cartesian coordinates, changing x by dx moves you a distance dx. In curvilinear coordinates, changing an angle by dφ does not move you a distance dφ, because an angle has no length unit. The real distance is the arc length = radius × angle, which is just the definition of the radian (see the trigonometric functions lesson). Nothing more is involved.

  • Cylindrical: turning φ by dφ at distance ρ from the axis traces an arc ρ dϕ\rho\,d\phi
  • Spherical: turning θ by dθ on a circle of radius r traces r dθr\,d\theta · turning φ by dφ on a latitude circle, whose radius is only rsin⁡θr\sin\theta, traces rsin⁡θ dϕr\sin\theta\,d\phi
Cylindrical: dV = ρ dρ dφ dzdρρ dφdzz axisThe curved edge is ρ dφ long (arc length = radius × angle)Spherical: dV = r² sin θ dr dθ dφdrr dθThird edger sin θ dφ(a latitude circleof radius r sin θ)θNear the pole (θ → 0) latitude circles shrink, so the element narrows as sin θ

V10 Differential length in the three systems

dl=dx ax+dy ay+dz az=dρ aρ+ρ dϕ aϕ+dz az=dr ar+r dθ aθ+rsin⁡θ dϕ aϕd\mathbf l = dx\,\mathbf a_x + dy\,\mathbf a_y + dz\,\mathbf a_z = d\rho\,\mathbf a_\rho + \rho\,d\phi\,\mathbf a_\phi + dz\,\mathbf a_z = dr\,\mathbf a_r + r\,d\theta\,\mathbf a_\theta + r\sin\theta\,d\phi\,\mathbf a_\phi

V11 Volume element, cylindrical

dV=ρ dρ dϕ dzdV = \rho\,d\rho\,d\phi\,dz

V12 Volume element, spherical

dV=r2sin⁡θ dr dθ dϕdV = r^2\sin\theta\,dr\,d\theta\,d\phi

V13 Surface elements used most often (direction normal to the surface)

dScylinder wall=ρ dϕ dz aρ,dSsphere=r2sin⁡θ dθ dϕ ard\mathbf S_{\text{cylinder wall}} = \rho\,d\phi\,dz\,\mathbf a_\rho,\qquad d\mathbf S_{\text{sphere}} = r^2\sin\theta\,d\theta\,d\phi\,\mathbf a_r

The lab above has “Show the volume element dV” switched on. It draws the real curved element and compares its true volume with ρ dρ dϕ dz\rho\,d\rho\,d\phi\,dz. Shrink Δ and the percentage difference falls toward zero: that is the “limit” step of slice, approximate, sum, limit once again.

Example V-4 · test the formulas on shapes you already know

Use V12 and V13 to find the volume and surface area of a sphere of radius R

  1. Volume: all three limits are constants, so the integral splits into a product

    V=∫02π ⁣dϕ∫0π ⁣sin⁡θ dθ∫0R ⁣r2dr=(2π)(2)(R33)=43πR3V = \int_0^{2\pi}\!d\phi\int_0^{\pi}\!\sin\theta\,d\theta\int_0^R\! r^2dr = (2\pi)(2)\Big(\frac{R^3}{3}\Big) = \frac43\pi R^3
  2. Surface at r = R: S=∫02π∫0πR2sin⁡θ dθ dϕ=R2(2)(2π)=4πR2S = \int_0^{2\pi}\int_0^\pi R^2\sin\theta\,d\theta\,d\phi = R^2(2)(2\pi) = 4\pi R^2

  3. Note ∫0πsin⁡θ dθ=2\int_0^\pi\sin\theta\,d\theta = 2. Forget the sin θ and you get π instead of 2, which is wrong immediately

43πR3\tfrac43\pi R^3 and 4πR24\pi R^2 ✓ · the thin shell 4πr2dr4\pi r^2dr used in lesson 29.1 is V12 with both angles already integrated

Example V-5 · density that depends on angle

A sphere of radius R has ρv=ρ0cos⁡2θ\rho_v = \rho_0\cos^2\theta. Find the total charge.

  1. ρ_v depends on θ, so the shell 4πr2dr4\pi r^2dr no longer works; use the full V12

    Q=∫02π ⁣ ⁣∫0π ⁣ ⁣∫0Rρ0cos⁡2θ  r2sin⁡θ dr dθ dϕQ = \int_0^{2\pi}\!\!\int_0^{\pi}\!\!\int_0^R \rho_0\cos^2\theta\; r^2\sin\theta\,dr\,d\theta\,d\phi
  2. Split: ∫0Rr2dr=R33\int_0^R r^2dr = \tfrac{R^3}{3} · ∫02πdϕ=2π\int_0^{2\pi}d\phi = 2\pi · for θ substitute u=cos⁡θ, du=−sin⁡θ dθ\hlU{u = \cos\theta,\ du = -\sin\theta\,d\theta}

    ∫0πcos⁡2θsin⁡θ dθ=∫−11u2 du=23\int_0^\pi\cos^2\theta\sin\theta\,d\theta = \int_{-1}^{1}u^2\,du = \frac23
  3. Multiply: Q=ρ0⋅R33⋅23⋅2π=4πρ0R39Q = \rho_0\cdot\tfrac{R^3}{3}\cdot\tfrac23\cdot2\pi = \tfrac{4\pi\rho_0R^3}{9}

Q=4π9ρ0R3Q = \tfrac{4\pi}{9}\rho_0R^3 · one third of the constant-density case (the average of cos²θ over a sphere is 1/3)

The five-step recipe for any field integral Applied

This is what electromagnetics textbooks do every time, even when they do not number the steps. Follow it and the field of a ring, a disk, a loop or a straight wire all look the same on paper.

  1. Draw and place the axes for maximum symmetry, for example a ring in the xy plane centred at O, with the axis through the point you are asked about
  2. Write r for the field point and r′ for a general piece in Cartesian components; the general piece contains the integration variable (x′, φ′, z′)
  3. Find R = r − r′ and |R| with V1 and V2
  4. Write the source element dq=λ dl′dq = \lambda\,dl' or I dl′I\,d\mathbf l' in the same variable (for a ring dl′=a dϕ′dl' = a\,d\phi')
  5. Write the x, y, z components and integrate. First see which components vanish by symmetry (for example ∫cos⁡ϕ′=0\int\cos\phi' = 0); integrate only what is left
Example V-6 · the five steps on a ring of charge

A ring of radius a carries charge Q uniformly and lies in the xy plane. Find E\mathbf E at (0, 0, z).

  1. Steps 1–2: r=(0,0,z)\mathbf r = (0, 0, z) · the piece at angle φ′: r′=(acos⁡ϕ′, asin⁡ϕ′, 0)\mathbf r' = (a\cos\phi',\ a\sin\phi',\ 0)

  2. Step 3: R=(−acos⁡ϕ′, −asin⁡ϕ′, z)\mathbf R = (-a\cos\phi',\ -a\sin\phi',\ z) · R=a2+z2R = \sqrt{a^2 + z^2}, independent of φ′

  3. Step 4: dq=λ a dϕ′dq = \lambda\,a\,d\phi' with λ=Q/(2πa)\lambda = Q/(2\pi a)

  4. Step 5: dE=k dq RR3d\mathbf E = \dfrac{k\,dq\,\mathbf R}{R^3}, component by component

    Ex=kλaR3∫02π(−acos⁡ϕ′) dϕ′=0,Ey=0,Ez=kλa zR3∫02πdϕ′=kQz(a2+z2)3/2E_x = \frac{k\lambda a}{R^3}\int_0^{2\pi}(-a\cos\phi')\,d\phi' = 0,\quad E_y = 0,\quad E_z = \frac{k\lambda a\,z}{R^3}\int_0^{2\pi}d\phi' = \frac{kQz}{(a^2+z^2)^{3/2}}

E=kQz(a2+z2)3/2 az\mathbf E = \dfrac{kQz}{(a^2+z^2)^{3/2}}\,\mathbf a_z · the same result physics books get by drawing the cancellation, but with no guessing: ∫cos⁡ϕ′=0\int\cos\phi' = 0 does the work

See the pieces and the vector R of this example in 3D below. Choose “Ring of charge”, move the chosen piece, then switch on the field of every piece. The full treatment of each shape is lesson 29.3 (in Thai).

Eight practice problems Basic → Intermediate

Q1A charge at A(1, 0, 2); field point B(4, 4, 2). Find R\mathbf R, R and R^\hat{\mathbf R}.

R=(3,4,0)\mathbf R = (3, 4, 0), R=5R = 5

R^=(0.6, 0.8, 0)\hat{\mathbf R} = (0.6,\ 0.8,\ 0)

Q2Convert (−3, 3, 4) to cylindrical and spherical coordinates.

ρ=18=4.243\rho = \sqrt{18} = 4.243, φ in the second quadrant = 135° · r=34=5.831r = \sqrt{34} = 5.831, θ=cos⁡−1(4/5.831)=46.69∘\theta = \cos^{-1}(4/5.831) = 46.69^\circ

(4.243, 135∘, 4)(4.243,\ 135^\circ,\ 4) and (5.831, 46.69∘, 135∘)(5.831,\ 46.69^\circ,\ 135^\circ)

Q3Where is ρ=2, ϕ=−60∘, z=0\rho = 2,\ \phi = -60^\circ,\ z = 0?

2cos⁡(−60∘)=12\cos(-60^\circ) = 1, 2sin⁡(−60∘)=−32\sin(-60^\circ) = -\sqrt3

(1, −1.732, 0)(1,\ -1.732,\ 0)

Q4Use dS=ρ dρ dϕdS = \rho\,d\rho\,d\phi to find the area of a disk of radius a.

∫02π∫0aρ dρ dϕ=2π⋅a22\int_0^{2\pi}\int_0^a\rho\,d\rho\,d\phi = 2\pi\cdot\tfrac{a^2}{2}

πa2\pi a^2

Q5Volume of the cone inside a sphere: 0≤r≤R, 0≤θ≤60∘0\le r\le R,\ 0\le\theta\le60^\circ

2π⋅R33⋅[−cos⁡θ]0π/3=2πR33⋅122\pi\cdot\tfrac{R^3}{3}\cdot\big[-\cos\theta\big]_0^{\pi/3} = \tfrac{2\pi R^3}{3}\cdot\tfrac12

πR3/3\pi R^3/3

Q6A sphere of radius R has ρv=ρ0r2/R2\rho_v = \rho_0 r^2/R^2. Total charge?

4πρ0R2∫0Rr4dr\tfrac{4\pi\rho_0}{R^2}\int_0^R r^4dr

45πρ0R3\tfrac45\pi\rho_0R^3

Q7Find aρ⋅ax\mathbf a_\rho\cdot\mathbf a_x and aϕ⋅ax\mathbf a_\phi\cdot\mathbf a_x.

From V8

cos⁡ϕ\cos\phi and −sin⁡ϕ-\sin\phi

Q8Arc length of a quarter circle of radius 0.5 m, from V10

∫0π/2ρ dϕ=0.5⋅π2\int_0^{\pi/2}\rho\,d\phi = 0.5\cdot\tfrac\pi2

0.785 m

Common mistakes

WrongRightSee
R=r′−r\mathbf R = \mathbf r' - \mathbf rend − start: field point − sourceV1
Use kq/R2kq/R^2 but multiply by R\mathbf R, not R^\hat{\mathbf R}kqR/R3kq\mathbf R/R^3 or kqR^/R2kq\hat{\mathbf R}/R^2V3
Pull aρ\mathbf a_\rho or ar\mathbf a_r out of an integralConvert to ax,ay,az\mathbf a_x, \mathbf a_y, \mathbf a_z firstV8, V-3
dV=dρ dϕ dzdV = d\rho\,d\phi\,dz or dr dθ dϕdr\,d\theta\,d\phiInclude ρ and r2sin⁡θr^2\sin\thetaV11, V12
Measure θ up from the groundθ is measured down from the +z axisV7
Find φ with tan⁡−1(y/x)\tan^{-1}(y/x) without checking the quadrantUse atan2(y, x)V-2

Next: the electric field of continuous charge distributions, lesson 29.3 (in Thai), which uses everything on this page on rods, rings, disks and arcs. In English, the series continues with Transformers through integrals (29.9).

Frequently asked questions

What is the difference between r and r′ (r prime)?

r is the position vector of the point where you want the field (the field point). r′ is the position vector of the piece of charge or current that causes it (the source point). The prime is only a label. When you integrate, r′ moves over the whole source while r stays fixed.

Which way does R = r − r′ point?

Always from the source to the field point, because r′ + R = r. Its length is the distance between the two points, and R̂ = R/|R| is the direction of the electric field of a positive charge at that point.

Why does dV in spherical coordinates contain r² sin θ?

Because the small volume has edges dr, r dθ and r sin θ dφ. The second and third are arc lengths (radius times angle), and the circle around the z axis at angle θ has radius r sin θ. Multiplying the three edges gives r² sin θ dr dθ dφ.

Why can't I pull a_ρ out of an integral?

Because a_ρ is not constant. Its direction depends on the angle φ of each point: at φ = 0 it points along +x, at φ = 180° along −x. Before integrating a vector, write it in Cartesian components a_x, a_y, a_z, which point the same way everywhere.

Which coordinate system should I use?

Use the one that matches the shape. Boxes and sheets use Cartesian coordinates; wires, coaxial cables, solenoids and anything symmetric about an axis use cylindrical; point charges, spheres and shells use spherical. The right choice makes the limits of the integral constants.

Ajarn Mod · Teerawut Savangboon
Lecturer in Electrical Engineering, Dhonburi Rajabhat University, Samut Prakan, Thailand · Profile