Field inside an infinite uniform rectangular box, diverges? I was solving by direct integration the problem of an infinite rectangular box, with a nonzero width, e; charged with a constant density, $\rho$, as shown in the following picture:

The integrals are quite easy to solve, however, I've found that the field diverges inside the box, and I'm having trouble to understand why. If I think in the field of a point charge, where the field diverges where the charge is placed, the result seems reasonable. However, if I think in the field inside a uniformly charged sphere, that argument seems incorrect. One difference between those two cases is the amount of charge involved (infinite vs finite); so, maybe that would be the cause of the different behaviors of the field? I'm not completely sure about that, because, using the same argument for showing that the direction of the field made by an infinite sheet of charge is perpendicular to the sheet (see image below), I think that the responsible for the divergence, is the charge placed where I'm calculating the field. At least, if I calculate the field in the middle of the box, the contributions by the charges below and above that point (in the x direction) cancel each other, and the contribution by the charges that surround that point cancel each other, using the revolution symmetry of the infinite box (again, see image below).

 A: Ok, I'm going to clarify in an answer, since my comments seem to be leading to confusion.
You have presumably found, via Gauss's law, that the field outside this infinite rectangular object is finite, pointing away from the surface with magnitude $\frac{\rho e}{2\epsilon_o}$. I've used $e$ as the width, as you did in your drawing.
Let's say we're inside the object, a distance $a$ from the left side. Then we're a distance $e-a$ from the right side. We can divide the object up into two similar objects of width $a$ and $e-a$, and apply Gauss's law to each of these objects individually. By the principle of superposition, the total electric field is just the sum of the fields produced by the two individual objects. We find that the electric field is then
$\vec{E} = (\frac{\rho a}{2\epsilon_0}-\frac{\rho (e-a)}{2\epsilon_0})\hat{x}$
Note that this is finite. Also note that in the exact middle it gives zero, as desired.
You can also do this calculation by doing integrals, which will not diverge. So double-check your math!
