Direct computation:
Parameterize the top part of the circle
by

with
, and the line segment by

with
. Then



Using the fundamental theorem of calculus:
The integral can be written as

If there happens to be a scalar function
such that
, then
is conservative and the integral is path-independent, so we only need to worry about the value of
at the path's endpoints.
This requires


So we have

which means
is indeed conservative. By the fundamental theorem, we have
