derive (x-a)^2+((r^2-x^2)^(1/2)-b)^2