>>14062533I used polar coordinates to compute the quarter circle in [0,x]x[0,x].
https://en.wikipedia.org/wiki/Gaussian_integral#By_polar_coordinatesDoing just the quarter circle gives
>>14058337Then to do the remainder, I let r go from x to sqrt(2)x (the edge of the circle to the corner of the box) and let theta go from pi/4 -arccos(x/r) to pi/4 + arccos(x/r).
I changed r to sqrt(r) to get an easier integral (you could probably keep it as r).
Then I treated exp(-r) like a pdf on [x^2, 2x^2] and used convexity of arccos[x/sqrt(r)] to get a good approximation for small x that also stays decent for large x.
Notice I multiplied and divided by the weight of exp(-r), (exp(-x^2)-exp(-2x^2)), to normalize the pdf (it shows up in the arccos in the denominator performing the normalization)
https://en.wikipedia.org/wiki/Jensen%27s_inequalityJensen's inequality is pretty neat.