I am trying to calculate the electric field of a half wire in polar coordinates. At $y=R$ is a wire going from $-\infty$ to $0$ with charge density $\rho$.
I want to calculate the electric field at $(0,0)$
$$ \vec{E} = \frac{1}{4\pi\epsilon_0} \int_{0}^{-\infty} dx \; \frac{\rho}{r^2} \hat{r} $$
My idea was to integrate over the angle $\theta$ from $0$ to $\pi/2$. Then I get $\vec{r} = \frac{R}{\cos \theta} \hat{\theta}$ and my integral is
$$ \vec{E} = \frac{1}{4\pi\epsilon_0} \int_{0}^{\pi/2} d\theta \; \frac{\rho \cos^2 \theta}{R^2} \hat{\theta} $$
How do I solve this integral? I don't know what to do with $\hat{\theta}$ and what the resulting direction of the field is. Any suggestions?