# Electric Field and Continuous Charge Distribution

cwill53
Homework Statement:
If the source of an electric field is to be a continuous charge distribution, rather than point charges, the following integral gives the electric field at (x,y,z) which is produced by charges at other points (x’,y’,z’):
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int \frac{\rho (x',y',z')\hat{r}dx'dy'dz'}{r^{2}}$$
This is a volume integral, letting the variables of integration x’,y’,z’ range over all space containing charge, thus summing up the contributions of all the bits of charge. The unit vector ##\hat{r}## points from (x’,y’,z’) to (x,y,z) unless you put a minus sign in front of the integral which just reverses the direction of ##\hat{r}##.
Relevant Equations:
$$\vec{F}=q\vec{E}$$
I sort of understand the meaning of this integral, but I don't know how to evaluate it. I have never evaluated a volume integral. It would be very helpful if someone could explain in other words what this integral means and give an example evaluating it.

This is from Purcell's Electricity and Magnetism, 3rd Edition, by the way.

hutchphd and Delta2

Homework Helper
Gold Member
It is really a triple integral over the three dimensions. The above formula is an incorrectly written triple integral. The correct way to write it is as :
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dx'\,dy'\,dz'$$
You evaluate it from the inside to the outside, starting with the innermost integral (over ##dx'##).
Here it is with parentheses to make the order of evaluation clearer:
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dx'\right)dy'\right)\,dz'$$
To write it as a volume integral one would write:
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{V} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dV$$
where ##dV## is the infinitesimal increment of volume around the point ##(x',y',z')## and V is the volume over which the charges are distributed, or ##\mathbb R^3## for the most general case (there appears to be a Latex engine error in that sentence that renders the R for real numbers incorrectly). For the purpose of evaluation, volume integrals are usually converted to triple integrals before evaluating.

Last edited:
cwill53
Homework Helper
Gold Member
2022 Award
I sort of understand the meaning of this integral, but I don't know how to evaluate it. I have never evaluated a volume integral. It would be very helpful if someone could explain in other words what this integral means and give an example evaluating it.

This is from Purcell's Electricity and Magnetism, 3rd Edition, by the way.

I'm surprised that Purcell doesn't give an example. The most likely examples will involve some sort of symmetry. E.g. you could take ##V## to be a uniformly charged solid sphere; or, a solid sphere with charge density varying with radius. Although, you already know the answer to those from Gauss's law.

Often you would convert to spherical or cylindrical coordinates and take advantage of symmetries to simplify the integral.

cwill53
cwill53
It is really a triple integral over the three dimensions. The above formula is an incorrectly written triple integral. The correct way to write it is as :
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dx'\,dy'\,dz'$$
You evaluate it from the inside to the outside, starting with the innermost integral (over ##dx'##).
Here it is with parentheses to make the order of evaluation clearer:
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty}\left(\int_{-\infty}^{\infty} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dx'\right)dy'\right)\,dz'$$
To write it as a volume integral one would write:
$$\vec{E}(x,y,z)=\frac{1}{4\pi \varepsilon _{0}}\int_{V} \frac{\rho (x',y',z')\hat{r}}{r^{2}}\,dV$$
where ##dV## is the infinitesimal increment of volume around the point ##(x',y',z')## and V is the volume over which the charges are distributed, or ##\mathbb R^3## for the most general case (there appears to be a Latex engine error in that sentence that renders the R for real numbers incorrectly). For the purpose of evaluation, volume integrals are usually converted to triple integrals before evaluating.
Thanks a lot for this. I assume y and z are held constant when evaluating over dx, x and z when evaluating over dy, etc. Is this correct?

cwill53
I'm surprised that Purcell doesn't give an example. The most likely examples will involve some sort of symmetry. E.g. you could take ##V## to be a uniformly charged solid sphere; or, a solid sphere with charge density varying with radius. Although, you already know the answer to those from Gauss's law.

Often you would convert to spherical or cylindrical coordinates and take advantage of symmetries to simplify the integral.
I’m only about halfway through MIT OpenCourseWare’s 18.02SC Multivariable Calculus course. The main thing I’m lacking is mathematical maturity tbh. I have an E&M class this semester which is why I’ll need some things sooner rather than later. I’ve heard of cylindrical and spherical coordinates but I don’t know how to apply them yet.

Homework Helper
Gold Member
2022 Award
I’ve heard of cylindrical and spherical coordinates but I don’t know how to apply them yet.
Spherical coordinates definitely need to be on the priority list. They are indispensable for much of physics - including E&M.

PhDeezNutz and cwill53
Homework Helper
Gold Member
2022 Award
I assume y and z are held constant when evaluating over dx, x and z when evaluating over dy, etc.
Yes, but bounds can be tricky.
Frequently one is integrating over a region specified by a bounding surface. Sometimes you can keep it relatively simple by suitable choice of volume element, e.g. using cylindrical coordinates for a cylinder or cone. In other cases, the bounds for one integration variable may depend on the value of another, e.g. integrating over a tetrahedron.

cwill53
It's probably easier to see how it fits together if you write it as$$\vec{E}(\vec{x}) = \int_{\mathbb{R}^3} d^3 x'\frac{\rho(\vec{x}')}{4\pi \epsilon_0} \frac{(\vec{x} - \vec{x}')}{|\vec{x} - \vec{x}'|^3}$$where ##\vec{x} - \vec{x}' = (x-x')\vec{e}_x + (y-y')\vec{e}_y + (z-z')\vec{e}_z## is the vector from a charge element ##\rho(\vec{x}') d^3x'## to the position ##\vec{x}##. When you use spherical or cylindrical coordinates you just need to switch out the volume element, and also keep in mind the limits will be different (e.g. for spherical you could use ##\phi \in [0, \pi]##, ##\theta \in [0, 2\pi]## and ##r \in [0, \infty)##).

When there isn't symmetry to exploit, the hardest part is to figure out the limits on the integrals. N.B. often you're interested in scenarios where ##\rho## is non-zero in some region and zero everywhere else, which is essentially the same as restricting the domain of integration.

Look here for some info on limits in volume integrals:
https://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/4.-triple-integrals-and-surface-integrals-in-3-space/part-a-triple-integrals/session-74-triple-integrals-rectangular-and-cylindrical-coordinates/MIT18_02SC_MNotes_i3.pdf

Last edited by a moderator:
cwill53 and Delta2
cwill53
Spherical coordinates definitely need to be on the priority list. They are indispensable for much of physics - including E&M.
Yea, I‘m honestly pretty lazy for not getting through more of the course this summer. I will get to them very soon.

cwill53
I'm surprised that Purcell doesn't give an example. The most likely examples will involve some sort of symmetry. E.g. you could take ##V## to be a uniformly charged solid sphere; or, a solid sphere with charge density varying with radius. Although, you already know the answer to those from Gauss's law.

Often you would convert to spherical or cylindrical coordinates and take advantage of symmetries to simplify the integral.
Also to clarify, they did give an example, immediately converting to cylindrical coordinates. But it seemed as though they used a different approach. The example problem they did was pretty complicated and necessitated the use of cylindrical coordinates.

Homework Helper
Gold Member
2022 Award
Also to clarify, they did give an example, immediately converting to cylindrical coordinates. But it seemed as though they used a different approach. The example problem they did was pretty complicated and necessitated the use of cylindrical coordinates.
Cylindrical and spherical coordinates and multi-variable calculus are prerequisites for the study of E&M. You may get bogged down quickly if you don't have those mathematical building blocks.

PhDeezNutz, etotheipi and cwill53
cwill53
It's probably easier to see how it fits together if you write it as$$\vec{E}(\vec{x}) = \int_{\mathbb{R}^3} d^3 x'\frac{\rho(\vec{x}')}{4\pi \epsilon_0} \frac{(\vec{x} - \vec{x}')}{|\vec{x} - \vec{x}'|^3}$$where ##\vec{x} - \vec{x}' = (x-x')\vec{e}_x + (y-y')\vec{e}_y + (z-z')\vec{e}_z## is the vector from a charge element ##\rho(\vec{x}') d^3x'## to the position ##\vec{x}##. When you use spherical or cylindrical coordinates you just need to switch out the volume element, and also keep in mind the limits will be different (e.g. for spherical you could use ##\phi \in [0, \pi]##, ##\theta \in [0, 2\pi]## and ##r \in [0, \infty)##).

When there isn't symmetry to exploit, the hardest part is to figure out the limits on the integrals. N.B. often you're interested in scenarios where ##\rho## is non-zero in some region and zero everywhere else, which is essentially the same as restricting the domain of integration.

Look here for some info on limits in volume integrals:
https://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/4.-triple-integrals-and-surface-integrals-in-3-space/part-a-triple-integrals/session-74-triple-integrals-rectangular-and-cylindrical-coordinates/MIT18_02SC_MNotes_i3.pdf
What exactly are ##\vec{e}_x##, ##\vec{e}_y## , and ##\vec{e}_z## in this case?

What exactly are ##\vec{e}_x##, ##\vec{e}_y## , and ##\vec{e}_z## in this case?

They're unit vectors of a Cartesian coordinate system. Sometimes you see them called ##\{ \hat{x}, \hat{y}, \hat{z} \}## or even ##\{ \hat{i}, \hat{j}, \hat{k} \}##, although I'm not a fan of the last one!

PhDeezNutz, cwill53, weirdoguy and 1 other person
cwill53
They're unit vectors of a Cartesian coordinate system. Sometimes you see them called ##\{ \hat{x}, \hat{y}, \hat{z} \}## or even ##\{ \hat{i}, \hat{j}, \hat{k} \}##, although I'm not a fan of the last one!
Thank you so much for the clarification.

etotheipi
cwill53
It's probably easier to see how it fits together if you write it as$$\vec{E}(\vec{x}) = \int_{\mathbb{R}^3} d^3 x'\frac{\rho(\vec{x}')}{4\pi \epsilon_0} \frac{(\vec{x} - \vec{x}')}{|\vec{x} - \vec{x}'|^3}$$where ##\vec{x} - \vec{x}' = (x-x')\vec{e}_x + (y-y')\vec{e}_y + (z-z')\vec{e}_z## is the vector from a charge element ##\rho(\vec{x}') d^3x'## to the position ##\vec{x}##. When you use spherical or cylindrical coordinates you just need to switch out the volume element, and also keep in mind the limits will be different (e.g. for spherical you could use ##\phi \in [0, \pi]##, ##\theta \in [0, 2\pi]## and ##r \in [0, \infty)##).

When there isn't symmetry to exploit, the hardest part is to figure out the limits on the integrals. N.B. often you're interested in scenarios where ##\rho## is non-zero in some region and zero everywhere else, which is essentially the same as restricting the domain of integration.

Look here for some info on limits in volume integrals:
https://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/4.-triple-integrals-and-surface-integrals-in-3-space/part-a-triple-integrals/session-74-triple-integrals-rectangular-and-cylindrical-coordinates/MIT18_02SC_MNotes_i3.pdf
I’m reading this again nearly a year later, and it makes so much more sense now. Thank you so much.

PhDeezNutz and hutchphd