I'm trying to do this physics problem and I'm messing up the integral somewhere. The problem:
Suppose there is a ring of radius $a$ with a uniform charge distribution and a total charge of $Q$. Calculate $\vec{E}$ for a point $P$ equidistant from all points on the ring and distance $x$ from the center of the ring.
My work:
Let the center of the ring be the origin, let $P = x \hat{i}$, and let $\theta$ be the angle at $0$ between $a\hat{k}$ and a selected point on the ring.
$$d\vec{E} = \frac{k_edQ}{(x^2 + a^2)^{\frac{3}{2}}}(x\hat{i} + a\sin \theta \hat{j} +a \cos \theta \hat{k}) $$ $$\vec{E} = \int_0^{2 \pi}\frac{k_eQ}{(x^2 + a^2)^{\frac{3}{2}}}(x\hat{i} + a\sin \theta \hat{j} +a \cos \theta \hat{k})d \theta $$ $$= \frac{k_eQ}{(x^2 + a^2)^{\frac{3}{2}}} \int_0^{2 \pi}(x\hat{i} + a\sin \theta \hat{j} +a \cos \theta \hat{k})d \theta$$ $$= \frac{k_eQ}{(x^2 + a^2)^{\frac{3}{2}}} \bigg[x \theta\hat i -a\cos \theta \hat j +a \sin \theta \hat k \bigg]_0^{2 \pi} $$ $$= \frac{k_eQ}{(x^2 + a^2)^{\frac{3}{2}}} (2 \pi x \hat i) $$
I feel like this is wrong. If so, what did I mess up?
The $2\pi$ shouldn't be there. You can start by saying that all $dE_y$ will cancel out because of symmetry. Hence, you are left with only $dE_x$.
This means that
$$ dE_x = \displaystyle\frac{k}{r^2}\cos \theta dQ,$$
where $r^2 = x^2 + y^2$ and $\cos \theta = \frac{x}{r}$.
This should mean that
$E_x = \displaystyle\int \displaystyle\frac{kx}{(x^2+a^2)^{3/2}}dQ$ which is a whole lot easier to integrate.