# Electromagnetism, vector calculus.

1. Nov 18, 2008

### Spoony

Hey i was wondering about a paticular problem i found in a text book. Specifically just one little niggle i have with it.

i am given that the electrostatic potential energy in a region of space is given by
v(r) = ((q*n)/(epsilon-0))(x^2+y^2)
(where n is a constant of dimensions m^-3)

It then goes on to say calculate the electric field, so E= -grad(V)

since v is a scalar field then grad(v) is simply
-gradv = E = -( d/dx (v)i + d/dy (v)j + d/dy (v)k )
and in this case the d/dx is a partial derivitive.

So i have to partial differeniate V with respect to all co-ords and then stick a vector on each direction respective of what its been differentiated by.
But i have a problem, the n is a constant so it's constant througout the region of space, but does it get differentiated?
common sense says no as to keep the dimensions required for an electric field E it'd need to have 1/distance^2 as the actual final units of distance (after cancelling the quotants)
and not differenctiating the n would make this so.

BUT im unsure as i rarely trust common sense with physics anymore :P especially since starting quantum physics this year :(.

Thanks guys

Last edited: Nov 18, 2008
2. Nov 18, 2008

### gabbagabbahey

The key phrase to consider is n is a constant...do you ever differentiate a constant?!

Also, you want to make sure you differentiate the electric potential (aka voltage), not the potential energy....the two quantities are related, but distinct.

If v(r) really represents the potential energy, then the units of n must be meters, not meters cubed.

In addition, even if n was a function ox x and y, when you use the product rule to differentiate V, you should still get the correct units-- when you consider the term involving the derivative of n, the rest of the stuff multiplying n is not differentiated in the same term, so the units still work out fine.

3. Nov 18, 2008

### Spoony

v(r) represents the electrostatic potential (sorry shoudlve been more precise and actually accurate), also the units of n are actually m^-3, typo above which is corrected.
I was almost sure that i would not have to differentiate the n at all as it was constant and remains the same throughout the electrostatic potential, scalar field, therefore logically itd stay the same throughout the electric, vector field.
But i just doubted myself because i wanted to be 100% sure about this trival thing.

4. Nov 18, 2008

### gabbagabbahey

No worries, it's always a good idea to ask when you're not 100% sure about something.

5. Nov 18, 2008

### Spoony

Thanks for the help mate :)
one more thing though, it then asks to calculate the electric charge density which is simply div(E) = p / (epsilon-0)

where p is the charge density.

All well and good its simply:

d/dx (Ex) + d/dy(Ey) + d/dz(Ez) = p / (epsilon-0)

But it asks for the electric charge density in terms of (x,y,z) when i do the above computation i arrive with a solution that contains no x,y,z terms so this would mean that the electric charge density at any point in space is the same. Which would make not much sense.

i tried to visulise it as a wire going up the z axis that is infinatley long with an electric field induced towards the centre.

This is what i get from calculating the charge density p

p= -4nq

But no x,y,z terms.

Am i doing things right and the awnser is that the charge density at ANY given point is -4nq or have i missed something?

6. Nov 18, 2008

### gabbagabbahey

Your answer looks fine to me ....remember, v(r) is only ((q*n)/(epsilon-0))(x^2+y^2) in a certain region, so the charge density is only constant in that region.

An infinitely long cylinder along the z-axis of constant charge density -4nq should give you the same v(r) anywhere inside the cylinder, so I would say that is a good way to visualize the problem.