Formula For Finding Electric Field I am currently studying AP Physics and have a question about a formula. I know that from $E = \frac{F}{q}$, we get $dE = dF/q = \frac{1}{4 \pi \epsilon_0} \frac{dQ}{r^2}.$
However, I also see a formula: $$E = \frac{1}{4 \pi \epsilon_0} \int \frac{dq}{r^2} (\hat{x} \cos \theta +  \hat{y} \sin{\theta})$$ and was wondering in what context it is useful. Also, how is this formula derived? Does it only work in certain circumstances?
 A: Electric field and (Coulomb) force are vectors, meaning they have a direction. So from your first equation for electric field you could have written $$d{\bf E}=\frac{1}{4\pi\epsilon_0}\frac{dQ}{r^2}{\bf\hat r}$$ where ${\bf\hat r}$ is a unit vector pointing in the direction of the electric field (or force). Now your main equation $$E = \frac{1}{4 \pi \epsilon_0} \int \frac{dq}{r^2} (\hat{x} \cos \theta +  \hat{y} \sin{\theta})$$ could have been written $${\bf E} = \frac{1}{4 \pi \epsilon_0} \int \frac{dq}{r^2} {\bf\hat r}$$ where the unit vector is $${\bf\hat r}=\hat{x} \cos \theta +  \hat{y} \sin{\theta}$$ and is the same unit vector but in a two-dimensional Cartesian coordinate system.
Note that $\bf\hat r=\frac{r}{|r|}$ and $\bf |\hat r|=1$ so the "usefulness" of this depends on the problem you are doing. Some authors will give you a problem in cartesian coordinates and ask you to switch to polar, cylindrical or spherical coordinates or maybe vice-versa. A lot of computations in electrostatics have spherical symmetry, so the problem can be reduced to just one (the $\bf r$) coordinate. Others can be a little more subtle.
