Everything looks good except your answer. That integral does not evaluate to 1/2.
You want to maximize where . Setting reveals where f has its min and max.
Because is 'invariant to rotation' we can suppose that C is a circle centered in the origin and with radious R, so that we have to find the R that maximizes the contour integral. We can write...
(1)
If we compute the derivative of the (1) respect to R we find that it vanishes for so that R=1 is the requested value and the curve is [effectively...] the unity circle...
Kind regards