# Electric field of a circular arc at a point

Given that the circular arc wire with radius $r$ has a linear charge density $λ$. What is the Electric field at the origin?

I took a small segment $\mathrm dy$, which is $θ$ above the x-axis with charge $\mathrm dq=λ\,\mathrm dy$. Therefore $$d\vec{E}=\frac{kλ\cosθ\,\mathrm dy}{r^2}$$ as all other charges along the y-axis cancel out each other.

Now $\cosθ=x/r$. And $x^2+y^2=r^2$ is the equation of the arc. Therefore $\cosθ=\sqrt{r^2−y^2}/r$. And then proceeding to integrate $$\mathrm d\vec{E}=\frac{kλ\sqrt{r^2−y^2}\,\mathrm dy}{r^3}$$ and arrive at an answer, by integrating in the limits $\pm{r\sin(60^\circ)=\pm{\sqrt{3}r/2}}$.

But my text tackles the question the same way until, at a point it takes $\mathrm dy=r\,\mathrm dθ$ instead of taking it in the form of $\mathrm dy$ and integrating and then substitutes and integrates $$\mathrm d\vec{E}=\frac{kλ}{r}\cosθ\,\mathrm dθ$$ and taking the limits as $\theta=\pm{60^\circ}$and arriving at an answer. But my answer differs from the one arrived by my textbook. Am I wrong somewhere?

The first mistake is that you considered $\mathrm dq=\lambda\,\mathrm dy$. If you look closely, as you go up from the origin to higher $y$, you find that charge density per unit $y$ increases. Take instead $\lambda$ as charge per unit circumference of the wire: $$\lambda={\mathrm dq \over \mathrm dl} ={\mathrm dq \over r\mathrm d\theta}$$
Now, \begin{align} \mathrm dE&= {k\lambda\,\mathrm dl \over r^2} \cos{\theta} \\ &={k\lambda r\,\mathrm d\theta \over r^2} \cos{\theta} \end{align} \begin{align} E=\int_0^E\mathrm dE&= \int_{-\pi/3}^{\pi /3} {k\lambda \over r} \cos{\theta} \,\mathrm d\theta \\ &=\frac{k\lambda}{r}\cdot\left(\sin\frac{\pi}{3}-\sin\frac{-\pi}{3}\right) \\ &=\frac{k\lambda}{r}\cdot\sqrt{3} \end{align} where $r$ is the radius of the arc.