Q:

What is the average distance between two random points on two opposing sides of a square?

Tl;dr: Is the red median in this image the average distance between that corner and the opposite leg?

I'm trying to come up with an approximation for a physical problem which involves calculating average lengths of segments which span opposite sides of a square. I've come up with the following reasoning: because the maximum possible length is the square's diagonal and the minimum length is the side of the square, the problem actually reduces to finding the average distance between one 45 corner of a 45-45-90 triangle (whose hypotenuse is the square's diagonal) and the opposite leg. 
Now here's the (porbably very dumb and obvious) question: is it correct to say that the median starting from that corner to the opposite leg is precisely that average distance? And is it safe to say it is also the average distance between random points on opposite sides of a square with sides equal to the triangle's legs?

A:

Since the two points are moving independently on  opposite sides of $[0,1]^2$ we have to compute the integral
$$J:=\int_0^1\int_0^1\sqrt{1+(x-y)^2}\>dxdy\ .$$
This can be done in elementary terms; the result is, according to Mathematica,
$${2\over3}-{\sqrt{2}\over3}+{\rm arsinh}(1)\doteq1.07664\ .$$

