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?