# Showing Divergence Theorem Equivalence

• Eruditee
You should be integrating over the volume, not the boundaries, so you should have x, y, and z in your integrand.
Eruditee

## Homework Statement

The problem states that a cube encloses charge. This cube is given in three space by <0,0,0> and <a,a,a>. The electric field is given by:
$\hat{E}=\frac{4e}{a^{2}e_{0}}[\frac{xy}{a^{2}}\hat{i}+\frac{(y-x)}{a}\hat{j}+\frac{xyz}{a^{2}}\hat{k}]$. I am to find the total charge enclosed using both methods or "sides" of the divergence theorem equivalence.

## Homework Equations

$\displaystyle \iiint \limits_U \left({\nabla \cdot \mathbf F} \right) d V = \iint \limits_{\partial U} \mathbf F \cdot \mathbf n \ d S$
$\nabla=\frac{\partial}{\partial x}\hat{i}+\frac{\partial}{\partial y}\hat{j}+\frac{\partial}{\partial z}\hat{k}$

## The Attempt at a Solution

The first half worked out fine and makes sense, so I think this part is right. Do note; I do get a bit sloppy with notation; this is a rough draft:
$\int_{0}^{a}\int_{0}^{a}\int_{0}^{a}\nabla\bullet EdV$
$\nabla\bullet\hat{E}=\frac{4e}{a^{2}e_{0}}[ \frac{y}{a^{2}}\hat{i}+\frac{1}{a}\hat{j}+\frac{xy}{a^{2}}\hat{k}]$

$\frac{4e}{a^{2}e_{0}}\int_{0}^{a}\int_{0}^{a}\int_{0}^{a}(\frac{y}{a^{2}}+\frac{1}{a}+\frac{xy}{a^{2}})dV$
$=\frac{4e}{a^{2}e_{0}}\int(\frac{y}{a^{2}}+\frac{1}{a}+\frac{xy}{a^{2}})dx(dA)=\frac{4e}{a^{2}e_{0}}(\int(\frac{y}{a^{2}})dx+\int\frac{1}{a}dx)+\int\frac{xy}{a^{2}}dx)dA=\frac{yx}{a^{2}}+\frac{x}{a}+\frac{x^{2}y}{2a^{2}}|_{0}^{a}=\frac{y}{a}+1+\frac{y}{2} [\itex] [itex]=\frac{4e}{a^{2}e_{0}}\int_{0}^{a}(\frac{y}{a}+1+\frac{y}{2}dy)dz=\frac{y^{2}}{2a}+y+\frac{y^{2}}{4a}|_{0}^{a}=\frac{a}{2}+a+\frac{a}{4}$
$=\int\frac{a}{2}+a+\frac{a}{4}dz=\frac{az}{2}+az+\frac{az}{4}=\frac{a^{2}}{2}+a^{2}+\frac{a^{2}}{4}=a^{2}+\frac{a^{2}}{2}+\frac{a^{2}}{4}=a^{2}(\frac{1}{2}+\frac{1}{4})=\frac{3a^{2}}{4}*\frac{4e}{a^{2}e_{0}}=\frac{3e}{e_{0}}$
which makes sense, as there are 3 faces in which flux can go by?

However, the surface integral is a mess:
when z=a ; Sz(surface raised from xy by a)=a
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet-kdxdy =-\int_{0}^{a}\frac{xyz}{a^{2}}dxdy=-z\int_{0}^{a}\frac{xy}{a^{2}}dxdy=-\int\frac{x^{2}y}{2a^{2}}dy=\frac{-x^{2}z}{2a^{2}}\int ydy=\frac{-x^{2}zy^{2}}{4a^{2}}=-\frac{a^{3}}{4}$
likewise:
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet jdxdy =\frac{1}{a}\int_{0}^{a}(y-x)dxdz=\frac{1}{a}\int yx-\frac{x^{2}}{2}dz=yxz-\frac{x^{2}z}{2}=a^{2}-\frac{a^{2}}{2}$
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet idydz =\int \frac{xy}{a^{2}}dydz=\frac{x}{a^{2}}\int ydydz=\int\frac{xy^{2}}{2}dz=\frac{xy^{2}z}{a^{2}}=\frac{a^{2}}{2}$
And the total:
$a^{2}-\frac{a^{3}}{4}=\frac{4a^{2}-a^{3}}{4}=\frac{a^{2}(4-a)}{4}$

which I know is wrong because the flux is zero at a=4.

Where am I going wrong? I haven't done surface/volume integrals in about 4-5 years, so bear with me. I'm trying to relearn through Boas.

Eruditee said:

## Homework Statement

The problem states that a cube encloses charge. This cube is given in three space by <0,0,0> and <a,a,a>. The electric field is given by:
$\hat{E}=\frac{4e}{a^{2}e_{0}}[\frac{xy}{a^{2}}\hat{i}+\frac{(y-x)}{a}\hat{j}+\frac{xyz}{a^{2}}\hat{k}]$. I am to find the total charge enclosed using both methods or "sides" of the divergence theorem equivalence.

## Homework Equations

$\displaystyle \iiint \limits_U \left({\nabla \cdot \mathbf F} \right) d V = \iint \limits_{\partial U} \mathbf F \cdot \mathbf n \ d S$
$\nabla=\frac{\partial}{\partial x}\hat{i}+\frac{\partial}{\partial y}\hat{j}+\frac{\partial}{\partial z}\hat{k}$

## The Attempt at a Solution

The first half worked out fine and makes sense, so I think this part is right. Do note; I do get a bit sloppy with notation; this is a rough draft:
$\int_{0}^{a}\int_{0}^{a}\int_{0}^{a}\nabla\bullet EdV$
$\nabla\bullet\hat{E}=\frac{4e}{a^{2}e_{0}}[ \frac{y}{a^{2}}\hat{i}+\frac{1}{a}\hat{j}+\frac{xy}{a^{2}}\hat{k}]$

$\frac{4e}{a^{2}e_{0}}\int_{0}^{a}\int_{0}^{a}\int_{0}^{a}(\frac{y}{a^{2}}+\frac{1}{a}+\frac{xy}{a^{2}})dV$
$=\frac{4e}{a^{2}e_{0}}\int(\frac{y}{a^{2}}+\frac{1}{a}+\frac{xy}{a^{2}})dx(dA)=\frac{4e}{a^{2}e_{0}}(\int(\frac{y}{a^{2}})dx+\int\frac{1}{a}dx)+\int\frac{xy}{a^{2}}dx)dA=\frac{yx}{a^{2}}+\frac{x}{a}+\frac{x^{2}y}{2a^{2}}|_{0}^{a}=\frac{y}{a}+1+\frac{y}{2} [\itex] [itex]=\frac{4e}{a^{2}e_{0}}\int_{0}^{a}(\frac{y}{a}+1+\frac{y}{2}dy)dz=\frac{y^{2}}{2a}+y+\frac{y^{2}}{4a}|_{0}^{a}=\frac{a}{2}+a+\frac{a}{4}$
$=\int\frac{a}{2}+a+\frac{a}{4}dz=\frac{az}{2}+az+\frac{az}{4}=\frac{a^{2}}{2}+a^{2}+\frac{a^{2}}{4}=a^{2}+\frac{a^{2}}{2}+\frac{a^{2}}{4}=a^{2}(\frac{1}{2}+\frac{1}{4})=\frac{3a^{2}}{4}*\frac{4e}{a^{2}e_{0}}=\frac{3e}{e_{0}}$
which makes sense, as there are 3 faces in which flux can go by?

However, the surface integral is a mess:
when z=a ; Sz(surface raised from xy by a)=a
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet-kdxdy =-\int_{0}^{a}\frac{xyz}{a^{2}}dxdy=-z\int_{0}^{a}\frac{xy}{a^{2}}dxdy=-\int\frac{x^{2}y}{2a^{2}}dy=\frac{-x^{2}z}{2a^{2}}\int ydy=\frac{-x^{2}zy^{2}}{4a^{2}}=-\frac{a^{3}}{4}$
Your normal is pointing in the wrong direction. It should point outward from the volume, so on the z=a face, it should point in the ##+\hat{k}## direction.

likewise:
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet jdxdy =\frac{1}{a}\int_{0}^{a}(y-x)dxdz=\frac{1}{a}\int yx-\frac{x^{2}}{2}dz=yxz-\frac{x^{2}z}{2}=a^{2}-\frac{a^{2}}{2}$
$\int\int\hat{F}\bullet\hat{dS}=\int\int F\bullet idydz =\int \frac{xy}{a^{2}}dydz=\frac{x}{a^{2}}\int ydydz=\int\frac{xy^{2}}{2}dz=\frac{xy^{2}z}{a^{2}}=\frac{a^{2}}{2}$
And the total:
$a^{2}-\frac{a^{3}}{4}=\frac{4a^{2}-a^{3}}{4}=\frac{a^{2}(4-a)}{4}$

which I know is wrong because the flux is zero at a=4.

Where am I going wrong? I haven't done surface/volume integrals in about 4-5 years, so bear with me. I'm trying to relearn through Boas.
You need to calculate the flux through all six faces and sum them.

Also, your expression for ##\vec{E}## looks wrong. Should the z-component be ##xyz/a^3## rather than ##xyz/a^2##? It doesn't work out dimensionally otherwise.

Finally, I got a different result for the integral of the divergence, so you probably made an error integrating somewhere. Your setup looked fine.

1 person
Corrected

vela said:
Your normal is pointing in the wrong direction. It should point outward from the volume, so on the z=a face, it should point in the ##+\hat{k}## direction.

You need to calculate the flux through all six faces and sum them.

Also, your expression for ##\vec{E}## looks wrong. Should the z-component be ##xyz/a^3## rather than ##xyz/a^2##? It doesn't work out dimensionally otherwise.

Finally, I got a different result for the integral of the divergence, so you probably made an error integrating somewhere. Your setup looked fine.

Thankx, it was a cubed!

I actually made a mistake in the addition; it should be:
$=\int\frac{a}{2}+a+\frac{a}{4}dz=\frac{az}{2}+az+\frac{az}{4}=\frac{a^{2}}{2}+a^{2}+\frac{a^{2}}{4}=a^{2}+\frac{a^{2}}{2}+\frac{a^{2}}{4}=a^{2}(\frac{1}{2}+\frac{1}{4})+a^{2}=\frac{7a^{2}}{4}*\frac{7e}{4a^{2}e_{0}}=\frac{7e}{4e_{0}}$
I'm a bit lost with the surface integral.

Last edited:
Eruditee said:
Thankx, it was a cubed!

I redid the integral. Somehow, I decided to add an a in just the right place to make it consistent with the a cubed variety. Also, it comes out pretty neatly to be 3 times the charge through a plane, which makes sense because there's three flux possibilities? The professor I have seems to set up most of his problems to have a usually simple answer.
I'm not sure what you mean by three flux possibilities, but the integral should evaluate to ##\frac{7 e}{\epsilon_0}##.

It does look like that's the correct integral of divergence, but I'm not integrating properly for the surfaces. If I hold a surface constant, doesn't that mean the volume is just the area*the height of the surface, which is what I'm trying to do?
There's no volume involved in doing the surface integrals. I'm not sure what you're getting at.

vela said:
I'm not sure what you mean by three flux possibilities, but the integral should evaluate to ##\frac{7 e}{\epsilon_0}##.

There's no volume involved in doing the surface integrals. I'm not sure what you're getting at.

Sorry, I edited it before seeing your response. I'm getting 7/4ths. I'll try it again. thank you.

Eruditee said:
Sorry, I edited it before seeing your response. I'm getting 7/4ths. I'll try it again. thank you.
Yes, same answer youu got, forgot the constant coeff. I should do this much more neatly in lyx; the whole issue was adding improperly there.

Ok, so I finally got it done:
$=\frac{4e}{a^{2}e_{0}}\int(\frac{y}{a^{2}}+\frac{1}{a}+\frac{xy}{a^{3}})dx(dA)=\frac{4e}{a^{2}e_{0}}(\int(\frac{y}{a^{2}})dx+\int\frac{1}{a}dx)+\int\frac{xy}{a^{3}}dx)dA=\frac{yx}{a^{2}}+\frac{x}{a}+\frac{x^{2}y}{2a^{3}}|_{0}^{a}=\frac{y}{a}+1+\frac{y}{2a}$
$=\frac{4e}{a^{2}e_{0}}\int_{0}^{a}(\frac{y}{a}+1+\frac{y}{2a}dy)dz=\frac{y^{2}}{2a}+y+\frac{y^{2}}{4a}|_{0}^{a}=\frac{a}{2}+a+\frac{a}{4}$
$=\int\frac{a}{2}+a+\frac{a}{4}dz=\frac{az}{2}+az+\frac{az}{4}=\frac{a^{2}}{2}+a^{2}+\frac{a^{2}}{4}=a^{2}+\frac{a^{2}}{2}+\frac{a^{2}}{4}=a^{2}(\frac{1}{2}+\frac{1}{4})+a^{2}=\frac{7a^{2}}{4}*\frac{4e}{a^{2}e_{0}}=$
$\frac{7e}{e_{0}}$

And by the surface integral:
$First at x=0 (the yz axis) \int\int F\bullet-idydx=0$
$x=a \int\int F\bullet idydx=\frac{x}{a^{2}}\int\int ydydz=\frac{y^{2}zx}{2a^{2}}=\frac{a^{4}}{2a^{2}}=\frac{a^{2}}{2}$
$at y=0 \int\int F\bullet-jdxdz=\frac{1}{a}\int\int xdxdy=\frac{x^{2}z}{2a}=\frac{a^{2}}{2}$
This is where I went wrong; I automatically assumed this plane to be of zero when there was a y-x term not y-xy term or so.
$at y = a \int\int F\bullet jdxdz=\frac{1}{a}\int(y-x)dxdz=yxz-\frac{x^{2}z}{2}=\frac{a^{3}-\frac{a^{3}}{2}}{a}=a^{2}-\frac{a^{2}}{2}$
$at z = 0 \int\int F\bullet-kdxdz=0$
$at z=a \int\int F\bullet kdxdz=\frac{z}{a^{3}}\int xydxdy=\frac{x^{2}y^{2}z}{4a^{3}}=\frac{a^{5}}{4a^{3}}=\frac{a^{2}}{4}$

$\frac{a^{2}}{2}+\frac{a^{2}}{2}+a^{2}-\frac{a^{2}}{2}+\frac{a}{4}=a^{2}+\frac{a^{2}}{2}+\frac{a^{2}}{4}=a^{2}(\frac{1}{2}+\frac{1}{4})+a^{2}=\frac{7a^{2}}{4}*\frac{4e}{a^{2}e_{0}}=\frac{7e}{e_{0}}$

Thank you!

Aside: On a side note, I'm using lyx. I'm actually a MSCS student; I just want to work on scientific computation. Is there a real urgency in learning LaTex itself outside of WYSIG?

Last edited:
Good work!

I don't know if there's an urgency to learn LaTeX for your field, but it's not very hard to get decent at it.

## 1. What is the divergence theorem equivalence?

The divergence theorem equivalence, also known as Gauss's theorem, is a mathematical principle that relates the integral of a vector field over a closed surface to the volume integral of the divergence of the same vector field within the enclosed volume.

## 2. Why is the divergence theorem equivalence important?

The divergence theorem equivalence is important because it allows us to easily convert between surface and volume integrals, simplifying many calculations in physics and engineering. It also provides a deeper understanding of the relationship between the behavior of a vector field on a surface and within a volume.

## 3. How is the divergence theorem equivalence derived?

The divergence theorem equivalence is derived from the fundamental theorem of calculus and the continuity equation. By applying the divergence theorem to a small, closed volume around a point in a vector field, we can derive an expression for the change in the flux of the field through the surface of the volume. This expression is then extended to integrate over the entire volume, resulting in the equivalence.

## 4. What are some real-life applications of the divergence theorem equivalence?

The divergence theorem equivalence has many real-life applications, including fluid dynamics, electromagnetism, and heat transfer. It is used to calculate the flow of fluids through pipes, the electric and magnetic fields around charged particles, and the heat transfer in a solid object, among other things.

## 5. Are there any limitations to the divergence theorem equivalence?

While the divergence theorem equivalence is a powerful tool, it does have some limitations. It can only be applied to vector fields that satisfy certain mathematical criteria, such as being continuous and having continuous partial derivatives. Additionally, it is only valid for closed surfaces and cannot be used for open surfaces or surfaces with holes.

Replies
10
Views
1K
Replies
3
Views
314
Replies
1
Views
919
Replies
13
Views
3K
Replies
8
Views
1K
Replies
3
Views
982
Replies
1
Views
1K
Replies
44
Views
4K
Replies
19
Views
1K
Replies
2
Views
411