# How can a region of uniform charge density have an an axial (parallel to only one axis) electrostatic field?

This is a question from the second chapter (Problem 2.55) of Griffiths 'Introduction to Electrodynamics' fourth edition. The question says that if in a region, the electric field $$E$$ exists such that, $$E_x = ax$$ where $$a$$ is a constant, $$E_y=0$$ and $$E_z=0$$, what is the charge density. The charge density is given by the differential Gauss law, where, $$\nabla.E = \dfrac{\rho}{\epsilon_0}$$. This gives $$\rho=\epsilon_0a$$. Since $$a$$ is a constant, the charge density is uniform everywhere in the region. Now Griffiths further asks how could this uniform charge density produce an electric field that is parallel to just $$X$$ axis?

My intuitive answer is if there is an infinite slab like uniform distribution of charge where the slab has infinite length and breadth but a finite thickness, if the thickness is along the $$X$$ axis, the electric field will be along $$X$$ axis given as $$E_x = ax$$, $$E_y=0$$ and $$E_z=0$$.

However Griffiths himself answers this question in the instructors solution manual as given below. While I also agree to Griffiths on a broader picture, I want to know if my intuitive solution of an infinite slab of finite thickness wrong?

You're almost right. A slab of finite thickness $$d$$ but infinite in length and width will have a part of the field that is linear in $$x$$. To see this, consider your slab as a stack of thin sheets with constant charge density on them. The field of such an infinite sheet is constant and its direction depends only on the position of the plane relative to where you want to get the field.
Thus, to get the field at $$0\le x\le d$$ inside the slab, there will be basically $$x$$ sheets on the left, that would contribute a field towards $$+\hat x$$, and $$(d-x)$$ sheets on the right of $$x$$, that would contribute a field towards $$-\hat x$$. Thus the field inside the slab would be proportional to $$\rho(2x-d)/\epsilon_0$$. Clearly in the middle of the sheet, where $$x=d/2$$, the field is $$0$$ by symmetry.
This gives you $$\vec E=\frac{\rho}{\epsilon_0}(2x-d)\hat x$$, which is close but not quite what you want because of the constant term.
• If you take the origin at x=d/2, there won't be any constant term for $\vec{E}$ – ThePhysicist Feb 2 '19 at 6:33