Find the perimeter of region R which is bounded by y = 1/(x^2+1) and y = -cos(x).