# Find the charge using its density

1. Apr 10, 2014

### JasonHathaway

1. The problem statement, all variables and given/known data

A ball whose its center on the origin, with radius of 0.2m, and contains a charge density $\frac{2}{\sqrt{x^{2}+y^{2}}}c/m^{3}$

2. Relevant equations

$D=\frac{\psi}{S}=\frac{\psi}{4\pi r^{2}}$

Where $\psi=Q$.

3. The attempt at a solution

The density is $c/m^{3}$, which is volume not surface.
Anyway, I've used the previous equation $\frac{2}{\sqrt{x^{2}+y^{2}}}=\frac{Q}{4×\pi ×0.2^{2}} \rightarrow Q=\frac{2×4×\pi×0.2^{2}}{\sqrt{x^{2}+y^{2}}}$

Is that right?

2. Apr 10, 2014

### Simon Bridge

You have to integrate the density over the sphere volume.

3. Apr 10, 2014

### JasonHathaway

You mean $\int\limits_0^{2\pi} \int\limits_0^ \pi \int\limits_0^{0.2} \frac{2}{\sqrt{x^{2}+y^{2}}} r^{2} sin\theta dr d\theta d\phi$?

4. Apr 10, 2014

### CAF123

That formula would give you a charge per unit area and is only applicable when the density is uniform.

Yes, $Q = \int \rho\,\text{d}V$ in general and only when $\rho$ is not dependent on V (i.e is uniform throughout the volume) does this simplify to $Q = \rho \int \, \text{d}V = \rho V$. But you should express your integrand in spherical polar coordinates.

5. Apr 10, 2014

### ehild

yes, but express x2+y2 also in terms of spherical coordinates.

ehild

6. Apr 10, 2014

### Simon Bridge

That's what I had in mind - yep.
The symmetry of the density function suggests cylindrical-polar may be better.
Maybe look at the shell method?

in general, the volume element $\text{d}V$ at position $\vec r$ has charge $\text{d}q=\rho(\vec r)\text{d}V$

The total charge $Q$ in a volume $V$ is the sum of all those $\text{d}q$ elements: $Q=\int_V\text{d}q$

Always start with a sketch - try to understand the density function: where is it a maximum, where a minimum, how does it change, etc?