How to calculate the electric field using Gauss' s Law in this example? [closed]

Suppose we have an infinite cylinder (infinite in the z-direction) with radius $$a$$. Inside it, there is free charge density given by $$\rho = \rho_o \cos (kz - \omega t)$$ and current density given by $$\vec{J} = \hat{z} J_o \cos (kz - \omega t)$$.

I am trying to calculate the electric field (inside the cylinder) using the integral form of Gauss' s Law. Due to symmetry, I think that the electric field will have only a radial component, thus $$\vec{E} = \hat{r} E_r$$.

Choosing a cylinder as a Gaussian surface with height $$L$$, we have

$$\int_S \vec{E}\,\textrm{d}\vec{S} = \frac{Q_{enc}}{\epsilon_0} \Rightarrow \int_S \hat{r} E_r \hat{r} (r\,d\phi\,dz) = \frac{Q_{enc}}{\epsilon_0} \Rightarrow \int_{z=0}^L \int_{\phi=0}^{2 \pi} r E_r \,d\phi \,dz = \frac{Q_{enc}}{\epsilon_0} \Rightarrow 2 \pi L r E_r = \frac{Q_{enc}}{\epsilon_0}$$

In order to calculate the total charge enclosed by the Gaussian surface, we integrate the charge density

$$Q_{enc} = \int _0^{2 \pi }\int _0^r\int _0^{L } \rho_0 \cos (k z-t \omega ) r' \,d\varphi\,dr'\,dz = \frac{\pi r^2 \rho_0 (\sin (k L-\omega t )+\sin ( \omega t ))}{k}$$

Thus we get

$$E_r = \frac{r \rho_0 (\sin (k L- \omega t )+\sin ( \omega t ))}{2 \epsilon_0 k L}$$

This doesn't look correct, since we have dependence on $$L$$, which is arbitrary. Does anyone have any ideas where the problem might be with this solution?

closed as off-topic by John Rennie, ZeroTheHero, Jon Custer, user191954, Kyle KanosFeb 14 at 11:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – John Rennie, ZeroTheHero, Jon Custer, Community, Kyle Kanos
If this question can be reworded to fit the rules in the help center, please edit the question.

• There is no translational symmetry along the $z$ axis, therefore, the radial electrical field will depend on $z$. This means that when you integrate $E_r$ respect to $z$ you won't obtain $E_r L$. – TheAverageHijano Feb 13 at 16:12
• At some places along the length the charge density is zero while at others the charge density is not zero. So the E-field will not be in radial direction. – garyp Feb 13 at 16:17
• Welcome to Physics! Please note that this site is not a place to obtain solutions to worked problems. Please see this Meta post on asking homework-like questions and this Meta post for "check my work problems". – Kyle Kanos Feb 14 at 11:02

You'll not be able to exploit symmetry using Gauss' Law. Beacuse $$\rho$$ is not uniform along the $$z$$-axis you can't expect $$\mathbf{E}$$ to be radial nor you can take it outside the integral (it could have a dependence on $$z$$ as well). And the time varying current density $$\mathbf J$$ may create an electric field too. What you should do is solve for the retarded potentials \begin{align} \phi(\mathbf r, t) &= \frac{1}{4\pi\epsilon_0} \int \frac{\rho(\mathbf r', t')}{|\mathbf r - \mathbf r'|} \, dv' \\ \\ \mathbf{A}(\mathbf r, t) &= \frac{\mu_0}{4\pi} \int \frac{\mathbf{J}(\mathbf r', t')}{|\mathbf r - \mathbf r'|} \, dv' \end{align} (the integrals are over the primed variable) where $$t'$$ is the retarded time $$t' = t - \frac{|\mathbf r - \mathbf r'|}{c}$$ and then calculate $$\mathbf{E}$$ via $$\mathbf E = - \boldsymbol \nabla \phi - \frac{\partial \mathbf A}{\partial t}.$$ The integrals aren't necessarily easy to solve though, and you may have to resort to some approximation at some point (like taking the observation point far away from the cylinder such that $$r' \ll r$$).
Your solution seems to be totally fine for me. You don't have a linear distribution of charges along axis $$z$$, that is why $$L$$ is included in your answer.