$${dE_x = dE \cos \theta = \frac{1}{4 \pi \varepsilon_0} \frac{\lambda}{r^2} \cos \theta ds}$$