I have the following question regarding Electromagnetism. I have placed the question here instead of Physics Stack exchange since it is specifically the mathematics and not the physics concepts that I am questioning here:
I actually have the solutions to this question; the problem however is that I cannot understand the author's solutions.
So I will start by showing the author's solution to part $(\mathrm{i})$:
I know that this could be hard to read so I'll typeset all the wording and equations:
$$dQ=\text{Charge in element}\,=Q\frac{d \ell}{\ell}$$
Where $d \ell$ is the elemental length and $\ell$ is the total length of the ring.
$$|d \vec E|=\frac{1}{4\pi \epsilon_0 r^2}\cdot Q \frac{d \ell}{\ell}$$ Sum over all elements $\implies\,x\,$components add up, other (vertical) components cancel.
$$\implies |d \vec E_x|=\frac{1}{4\pi \epsilon_0 r^2}\cdot Q \frac{d \ell}{\ell}\cos\theta$$
Therefore
$$\fbox{$\color{red}{|\vec E_x|=\int_{0}^{\ell}\frac{Q}{4\pi\epsilon_0 r^2\ell}\cos\theta\, d \ell=\frac{Q\cos\theta}{4\pi\epsilon_0 r^2}}$}\tag{1}$$
This is in the negative $x$ direction which implies that $$\fbox{$\vec E=-\frac{Q\cos\theta}{4\pi\epsilon_0 r^2}\hat x$}$$
I understand everything apart from equation $(1)$ marked red. If I evaluate that integral by my logic I should get $$|\vec E_x|=\int_{0}^{\ell}\frac{Q}{4\pi\epsilon_0 r^2\ell}\cos\theta\, d \ell=\frac{Q\cos\theta\ln \ell}{4\pi\epsilon_0 r^2}\Bigg |_{0}^{\ell}$$ due to the $\frac{1}{\ell}$ factor in the integrand. Another thing that troubles me is that the integration variable $\ell$ is also the upper limit of the integration which can't be true.
Could someone please tell me if they think equation $(1)$ is indeed incorrect?
Or if it is myself the one making the error then could you please explain where I am going wrong?
Many thanks.


The issue here is sloppy notation. The arc length differential $d\ell$ over which we integrate is a different variable to the total length of the wire $\ell$, and as such the author should not use the same symbol. If we replace $d\ell$ with the (in my experience) standard arc length differential $ds$, we get:
$$|\vec{E}_x|=\int_0^\ell\frac{Q}{4\pi\epsilon_0 r^2\ell}\cos{\theta} \,ds=\frac{Qs\cos{\theta}}{4\pi\epsilon_0r^2\ell}\Bigg |_0^\ell=\frac{Q\cos{\theta}}{4\pi\epsilon_0r^2}$$