# Proof of electric field intensity due to an infinite conducting sheet

I am reading the proof of electric field due to large uniformly charged sheet. It is give as

Consider an elemental strip of width $$dx$$ at a distance $$x$$ from point $$O$$. The linear charge density $$\lambda=\sigma dx\tag{1}$$ where $$\sigma$$ is the surface charge density of the sheet.
Electric field at $$P$$ is $$E_P=dE\cos\theta$$
$$dE=\frac{2k\lambda}{\sqrt{x^2+r^2}}$$
So, $$E_P=\int_{-\infty}^{\infty} \frac{2k\sigma xdx}{x^2+r^2}$$
This gives $$E_P=\frac{\sigma}{2\epsilon_o}$$

I have understood the whole proof. But I have a doubt that how we arrived at $$(1)$$.
I tried to find it as
Suppose we take an element of strip of length $$dy$$ and width $$dx$$.
So, charge on it is $$\lambda\times length=\lambda dy\tag{2}$$
If we see it from the point of view of sheet then charge on the element is $$\sigma dxdy$$
Then if we equate it
$$\lambda dy=\sigma dxdy$$
We get $$\lambda =\sigma dx$$

But the problem is that why we take the charge on the element of strip of width $$dx$$ to be $$\lambda dy$$. Because in linear charge distribution we are ignoring the width of that element, just taking into account the length (if the distance at which the electyric feld is to be calculated is very large compared to the width of the element). But the expression of electric field is valid for all distances. So, how we equate it to the $$\sigma dxdy$$?
Please tell how exactly the $$(1)$$ comes.

$$\sigma = dq/dxdy$$ and so $$\sigma dx = dq/dy$$. But the $$dq$$ here is not the charge over the line of length dy but rather the charge in the rectangle of area dxdy. So the only time $$\sigma dx = \lambda$$ is when you take the limit that dx approaches zero and then you can add the contribution from each line seperately which is exactly what you did when you performed the integration.