# Electrostatics - finding the total charge of a sphere with varying charge density

## Homework Statement

I was given a sphere with radius R and a charge density function δ(r),where r is the distance from the center of the sphere. I want to find the total charge in the sphere.

## Homework Equations

I know that Q = δV

## The Attempt at a Solution

I tried integrating V ∫δ(r)dr over 0 to R, but I'm not sure that will give me the total charge, but am unsure that's the right way to go about this. is it? thanks.

Related Introductory Physics Homework Help News on Phys.org
I believe your approach is correct.

Just remember that when integrating from 0 to R in spherical coordinates your must remember to use the factors associated with this change of variable.

That is, I think you will want to integrate:

Q = $\int^{2\pi}_{0}$ $\int^{\pi}_{0}$ $\int^{R}_{0}$ $\delta$(r) r$^{2}$ sin$\theta$ dr d$\theta$ d$\phi$

where Q is the total charge enclosed by the sphere and R is the radius of the sphere.