# Varying Volume Charge Density in a Solid Cylinder

## Homework Statement

Consider a right circular cylinder with radius R and height L oriented along the z-axis. The center of the cylinder coincides with the origin. Inside the cylinder the volume charge density is given by $\rho(z)=\rho_0+\beta z$. Find the electric field at the origin (in terms of R, L, $\rho_0$, and $\beta$.

## Homework Equations

$\vec{E(\vec{r})}=\frac{1}{4\pi\epsilon_0}\int_a^b \! \rho(\vec{r'})\frac{\hat{\eta}}{\eta^2} \mathrm{d}\tau'.$

where $\vec{\eta}=\vec{r}-\vec{r'}$ and r is the field point and r' is the source point. Thus, in this problem, $\vec{r}$=0, $\eta=-\vec{r'}$ and $\eta^2=|\vec{r'}|^2$. Everything with a prime on it corresponds to r'.

## The Attempt at a Solution

In cylindrical coordinates, $\vec{\eta}=\vec{r'}=s'\hat{s'}+\phi'\hat{\phi'}+z'\hat{z'}$. As we want to know the electric field at the origin, in the volume charge density equation, would I set z=0, or would I set z=z' and then use the electric field integral formula integrating: $0\leq s'\leq R, 0\leq \phi'\leq 2\pi, -L/2\leq z\leq L/2$? On a side note, is it better to use Gauss' Law here?

Thanks.