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: No, it isn't, unless you're being very approximate. If you draw a line from the corner of a square to some point on an opposite edge, you've effectively constructed a right-triangle, of which one leg is equal to the side of the square in length, and you want to find the hypotenuse. This hypotenuse will thus have length $a\sqrt{1+x^{2}}$, where your square has side $a$ and $ax$ is the shorter leg (thus $x \in [0,1]$). This is not linear, so you can't just say the mean length is given by the median. You'd need to evaluate the following integral:
$$ \int_{0}^{1} a\sqrt{1+x^{2}} dx$$
assuming the choice of endpoint is uniformly distributed.
Further, I'm not 100% convinced that your problem can be reduced to fixing one point at a corner. Consider what happens if one endpoint is the midpoint of its side - then the maximum length of any line segment from that point to a point on the opposite side is going to be $a\sqrt{1+\left(\frac{1}{2}\right)^{2}} = a\sqrt{5/4}$, which is less than the diagonal, $a\sqrt{2}$. It's not simply enough to take the arithmetic mean of the maximum and minimum - you need to consider how likely the intermediate values are.
A: No, but it's close:
The average distance is
$$
\frac1a \int_0^a \sqrt{y^2 + a^2} dy =
\frac12 (\sqrt{2} + \sinh^{-1}(1))a
\approx 1.15a
$$
The length of the red line is
$$
\frac{\sqrt{5}}{2}a
\approx 1.12a
$$
The relative error is about $3\%$.
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\ .$$
