Suppose I've a hemisphere and an electric field passing horizontally through this hemisphere. I need to find the flux of this field through this hemisphere.
I can easily consider the electric field to be either $E\hat{x}$ or $E\hat{y}$. I know, the surface area element is given by $d\vec{S}=r^2\sin\theta d\theta d\phi \hat{r}$.
Using the definition of flux, I have : $$\Phi=\int_0^{\pi/2}\int_0^{2\pi}Er^2\sin\theta d\theta d\phi \hat{x}.\hat{r}(or\,\hat{y}.\hat{r}) = 0$$
However, I tried to solve this integral in a slightly different way, and was unable to get anywhere.
Here is my diagram, note that I labeled the field $\vec{E}=E\hat{e}$. This unit vector is also parallel to the $z$ axis and is not the cartesian unit vector.
The definition of the electric flux is $$\Phi=\iint \vec{E}.d\vec{S}$$
In this example, $d\vec{S}=r^2\sin\theta d\theta d\phi \hat{r}$. However, as clear from the diagram :
$$\hat{e}.\hat{r}=\cos\alpha=\cos(\pi/2 +\theta)=-\sin\theta$$
Writing the integral, we get :
$$\Phi=\int_0^{\pi/2}\int_0^{2\pi}Er^2\sin\theta d\theta d\phi \hat{e}.\hat{r} = \int_0^{\pi/2}\int_0^{2\pi}Er^2\sin\theta d\theta d\phi (-\sin\theta) \ne 0$$
Using this method, I'm not getting the correct answer. I have some idea regarding why this is wrong however, I'm unable to show that by using this method, and simple geometry, $\hat{e}.\hat{r}=\hat{x}.\hat{r} \,or\,\hat{y}.\hat{r}$, so that I get the correct answer.
For example, one issue that I note here is that, in the integral $\theta$ can take only positive values between $0$ and $\pi/2$. However, in the diagram, if I had drawn the area element to the left side of the $z$ axis, then we would have had $\hat{e}.\hat{r}=\cos(\pi/2 -\theta)$ instead. So, $\theta$ seems to depend on which side of the $z$ axis, I draw my radial vector ( on the $e-z$ plane ).
I want to show that the dot product $\hat{e}.\hat{r}=\hat{x}.\hat{r} \,or\,\hat{y}.\hat{r}$ purely using this diagram, which I think is correct. I want to solve the integral and get the same answer without assuming the electric field is along the $x$ or $y$ axis first.
Any help would be highly appreciated.
