# Line integral of a vector field defined in polar coordinate

For example, how to find

$$\vec I = \int_0^{\pi/2} \theta \hat{\theta} d\theta$$

where $$\hat{\theta}$$ is the azimuthal unit vector. The integrand is a vector field in azimuthal direction whose magnitude increases with $$\theta$$, and the integral is counter-clockwise along the upper-right quarter of a unit circle.

The trouble is that $$\hat{\theta}$$ itself varies with position. As a result the final answer cannot be something like $$A \hat{\theta}$$, it must also prescribe which $$\hat{\theta}$$ vector.

Of course, we can always resort to the omnipotent Cartesian coordinate. With $$\hat \theta \cdot \hat i = -\sin\theta, \hat \theta \cdot \hat j = \cos\theta$$ We can proceed component-wise $$\vec I = \left(\int_0^{\pi/2} \theta \hat{\theta}\cdot \hat i d\theta \right)\hat i + \left(\int_0^{\pi/2} \theta \hat{\theta}\cdot \hat j d\theta \right)\hat j = -\hat i+\left(\frac{\pi}{2}-1 \right) \hat j$$ It's not really satisfying to jump out of the polar coordinate just to do an integration.

How to find $$\vec I$$ within polar coordinate?

$$\int_0^{\frac{\pi}{2}} \theta \hat{\theta}d\theta = \theta \hat{r}\Bigr |_0^{\frac{\pi}{2}} - \int_0^{\frac{\pi}{2}} \hat{r}d\theta = \frac{\pi}{2}\hat{r}\left(\frac{\pi}{2}\right) + \hat{\theta}\left(\frac{\pi}{2}\right) - \hat{\theta}(0)$$
$$\hat{r}\left(\frac{\pi}{2}\right) = \hat{\theta}(0) = \hat{y}$$