Suppose an electric field E(x,y,z) has the form
Ex=ax,Ey=0,Ez=0
where a is a constant. What is the charge density? How do you account for the fact that the field points in a particular direction, when the charge density is uniform? [This is a more subtle problem than it looks, and worthy of careful thought.]