Change in Electric Field inside a conductor I was reading Purcell's E&M and the author was showing how the force on the charge distribution per unit area for a thin spherical shell with surface charge density of $\sigma$ is proportional to the average of the electric field just above and just below the surface.

He tried to show something more general to prove it. He wanted to show that the thin slab of thickness $dx$ in the diagram has force per unit area proportional to $(E_1 + E_2)/2$ where $E_1$ and $E_2$ are electric fields just to the left and right of the slab respectively. The diagram is a picture of a cross section near the surface of a charged object (like maybe the thin shell itself). Here he uses
$$E_2 - E_1 = 4 \pi \sigma = 4 \pi \rho dx$$
which comes from applying Gauss's law near the slab (cgs units). My problem with this is that he is claiming that the electric field changes by $4 \pi \sigma$ as we move from left to right. But that's only if we count the electric field for the charges enclosed by the Gaussian surface. What about the charges outside the Gaussian surface? I know that their flux will be zero but that doesn't mean that the electric field due to them at $x$ and $x+dx$ will be the same.
 A: Yeah, you are right Purcell didn't consider the possibility of charges other than the spherical shell. So you can do this it in a more general way without taking a spherical shell.
Suppose you have Electric field $\mathbf{E}$ in space due to some charge distribution. The electric field always undergoes a discontinuity
when you cross a surface charge $\sigma$. In fact, it is a simple matter to find the amount
by which $\mathbf{E}$ changes at such a boundary. Gauss's law says in SI units
$$\oint_S\mathbf{E}\cdot d\mathbf{a}=\frac{Q_{enc}}{\epsilon_0}=\frac{\sigma  A}{\epsilon_0}$$

Diagram from Griffiths, Introduction to Electrodynamics
where $A$ is the area of the pillbox lid. (If $\sigma$ varies from point to point or the surface
is curved, we must pick $A$ to be extremely small.) Now, the sides of the pillbox contribute nothing to the flux, in the limit as the thickness $\epsilon$ goes to zero, so we are left with
$$E^{\perp}_{above}-E^{\perp}_{below}=\frac{\sigma  }{\epsilon_0}$$
The normal component of $\mathbf{E}$ is discontinuous by an amount $\sigma/\epsilon_0$ at any boundary.
The tangential component of $\mathbf{E}$, by contrast, is always continuous. For if we
apply
$$\oint \mathbf{E}\cdot d\mathbf{l}=0$$
or $$E^{||}_{above}=E^{||}_{below}.$$
Explanation For Purcell's idea
We consider a continuous change in the electric field going from one side to the other side. 
The figure shows how the density changes (figure shows a cross section  of surface.) Now see how the electric field change going from $x$ to $x+dx$.
$$E(x+dx)-E(x)=\frac{\rho(x) dx}{\epsilon_0}$$
$$dE=\frac{\rho(x) dx}{\epsilon_0}$$
$$\int_{E_1}^{E_2}dE=\int_0^{x_0}\frac{\rho(x) dx}{\epsilon_0}$$
$$E_2-E_1=\int_0^{x_0}\frac{\rho(x) dx}{\epsilon_0}$$
That's the exact equation that are used in the whole discussion.
I hope this will help you. Best wishes!

A: I don't know whether this would help... But this is how I kind of figured it out and skipped when I read that.
If we consider Gauss's law in differential form :
$\vec \nabla \cdot \vec E = \frac{\rho} {\varepsilon_0}$
and Imagine the slab to be broad enough that variations in $E$ about $Z$ and $Y$ are negligible, Then the equation becomes :
$\frac{\partial E} {\partial x} = \frac{\rho} {\varepsilon_0}$
$\frac{E(x+dx) - E(x) } { dx} = \frac{\rho} {\varepsilon_0}$
EDIT
Also, I don't find any inconsistency when applying gauss's law directly. Could you please clarify?
I assume the electric Field from the slab is along X alone partly due to symmetry and partly because it is an element of a broad slab.
Let $\vec E(x)$ be the net electric field inside the slab (due to charges outside and inside).
We know that $\int \vec E\cdot d\vec s= \frac{q_{in}} {\varepsilon_0} $ is valid if we consider or not consider Electric field from outside charges.
So we can very well say that :
$E(x+dx) \cdot A - E(x) \cdot A + \text{flux from sides} = \frac{\rho \cdot A dx}{\varepsilon_0} $
And for a slab of limiting thickness, flux from sides can be neglected and A can be cancelled to get the result.
Here I believe I did consider contribution to $\vec E$ from all charges.
