We're computing the line integral
It looks like the circular part of
should be along the circle
starting at (4,0) and terminating at
.
Because integrating with respect to a parameterization seems like it would be a pain, let's check to see if
is a conservative vector field. For this to be the case, if
, then
is conservative iff
.
We have
and
. The corresponding partial derivatives are
and so the vector field is indeed conservative.
Now, we want to find a function
such that
. We have
Integrating with respect to
yields
Differentiating with respect to
gives
and so
Because
is conservative, and a potential function exists, the line integral is path-independent and the fundamental theorem of calculus of line integrals applies, so we can evaluate the line integral by evaluating the potential function at the endpoints. We end up with