Tiago3434 said:
Like, if dq=λds, I don't understand how come the integrals ∫dq and ∫λds could end up being different.
Those integrals are not different but those are not the integrals for the electric field. The integral for the electric field also contains a directional element ##\hat{r}## which may weight the electric field more in one direction than the other.
In general
$$\mathbf{E}=\frac{1}{4\pi\epsilon_{0}}\int\frac{dq}{r^{2}}\hat{r}$$
As an example, let's assume you are looking for ##\mathbf{E}## at the center of the ring, then ##\hat{r}=-\text{cos}\theta\hat{x}-\text{sin}\theta\hat{y}##. If the ring has a radius of ##R## then
$$\mathbf{E}=\frac{-1}{4\pi\epsilon_{0}}\int\frac{dq}{R^{2}}(\text{cos}\theta\hat{x}+\text{sin}\theta\hat{y})$$
Now let's assume the ring has some varying linear charge density ##\lambda=\alpha\text{cos}\theta## then
$$dq=\lambda Rd\theta=\alpha\text{cos}\theta\;Rd\theta$$
The electric field is now
$$\mathbf{E}=\frac{-1}{4\pi\epsilon_{0}}\int_{0}^{2\pi}\frac{\alpha\text{cos}\theta\;Rd\theta}{R^{2}}(\text{cos}\theta\hat{x}+\text{sin}\theta\hat{y})$$
$$\mathbf{E}=\frac{-\alpha}{4\pi\epsilon_{0}R}\left[\int_{0}^{2\pi}\text{cos}^{2}\theta\;d\theta\hat{x}+\int_{0}^{2\pi}\text{cos}\theta\text{sin}\theta\;d\theta\hat{y})\right]$$
$$\mathbf{E}=\frac{-\alpha}{4\pi\epsilon_{0}R}\left[\pi \hat{x}+0\hat{y})\right]=\frac{-\alpha}{4\epsilon_{0}R}\hat{x}$$
Now if we consider the case of constant charge density ##\lambda##
$$\mathbf{E}=\frac{-1}{4\pi\epsilon_{0}}\int_{0}^{2\pi}\frac{\lambda Rd\theta}{R^{2}}(\text{cos}\theta\hat{x}+\text{sin}\theta\hat{y})$$
$$\mathbf{E}=\frac{-\lambda}{4\pi\epsilon_{0}R}\left[\int_{0}^{2\pi}\text{cos}\theta\;d\theta\hat{x}+\int_{0}^{2\pi}\text{sin}\theta\;d\theta\hat{y})\right]$$
$$\mathbf{E}=\frac{-\lambda}{4\pi\epsilon_{0}R}\left[0 \hat{x}+0\hat{y})\right]=0$$
These two answers are different because including the direction ##\hat{r}## selects which parts of the charge density will add together in some direction and which will cancel out in another direction.