Maximum product of distances to the vertices of a square Suppose a unit square $ABCD$. Where is point $P$, inside or on the square, such that $Q=PA\cdot PB\cdot PC\cdot PD$ is maximized?

I solved this numerically with a computer, and curiously and counterintuitively (after all, there's symmetry), the answer is not the middle of the square but rather the midpoint of any of the four edges (for the former $Q=\frac{1}{4}$ while for the latter $Q=\frac{5}{16}$).

Two questions arise: firstly, how does one solve this problem using calculus (without a computer), and secondly, is there a nice explanation for why the maximum does not occur at the center of the square?
Starting with the second question, I would intuitively put the point in the middle if I were to minimize the distance to all four vertices. Perhaps your intuition betrayed you?

Nonetheless, onto the first question:

Assume that the square's vertices are the points $(0,0), (1,0), (1,1), (0,1)$. Therefore a point $P = (x, y)$ inside the square has $0 \leq x \leq 1; 0 \leq y \leq 1$. Also, the distance of the point to the vertices can be found with the pythagorean theorem.


Distance to $(0, 0)$ is $\sqrt{x^2 + y^2}$;
Distance to $(1, 1)$ is $\sqrt{(1-x)^2 + (1-y)^2}$;
Distance to $(0, 1)$ is $\sqrt{x^2 + (1-y)^2}$;
Distance to $(1, 0)$ is $\sqrt{(1-x)^2 + y^2}$;


Thus you want to maximize the function

$$D(x, y) = \sqrt{x^2 + y^2}\cdot\sqrt{(1-x)^2 + (1-y)^2}\cdot\sqrt{x^2 + (1-y)^2}\cdot\sqrt{(1-x)^2 + y^2}$$

We can use derivatives to find all the candidate points for the maximum and then find it; If we derive $D$ and find the zeroes of its gradient, we see that its only zero is at $(\frac12, \frac12)$. We then check if it is a maximum, and we see it is not. Now, the square is limited and compact and our $D$ function is continuous, thus because of the Weierstrauss Theorem, $D$ must have a maximum on the square. If we could not find it with our test, it is because the function must be growing as we step away from the center; therefore the maximum occurs at the border of the square, in one edge. 

Because of the symmetry of our function, one can understand that the values at the edges are the same, so the $4$ edges will have a point that maximizes the distance function. One can then use intuition to understand that the farther away from the two vertices of that edge, the better. If "intuition" is not good enough for you, one can then again use calculus. Let me know if you think it is needed.
Starting with the second question, I would intuitively put the point in the middle if I were to minimize the distance to all four vertices. Perhaps your intuition betrayed you?

Nonetheless, onto the first question:

Assume that the square's vertices are the points $(0,0), (1,0), (1,1), (0,1)$. Therefore a point $P = (x, y)$ inside the square has $0 \leq x \leq 1; 0 \leq y \leq 1$. Also, the distance of the point to the vertices can be found with the pythagorean theorem.


Distance to $(0, 0)$ is $\sqrt{x^2 + y^2}$;
Distance to $(1, 1)$ is $\sqrt{(1-x)^2 + (1-y)^2}$;
Distance to $(0, 1)$ is $\sqrt{x^2 + (1-y)^2}$;
Distance to $(1, 0)$ is $\sqrt{(1-x)^2 + y^2}$;


Thus you want to maximize the function

$$D(x, y) = \sqrt{x^2 + y^2}\cdot\sqrt{(1-x)^2 + (1-y)^2}\cdot\sqrt{x^2 + (1-y)^2}\cdot\sqrt{(1-x)^2 + y^2}$$

We can use derivatives to find all the candidate points for the maximum and then find it; If we derive $D$ and find the zeroes of its gradient, we see that its only zero is at $(\frac12, \frac12)$. We then check if it is a maximum, and we see it is not. Now, the square is limited and compact and our $D$ function is continuous, thus because of the Weierstrauss Theorem, $D$ must have a maximum on the square. If we could not find it with our test, it is because the function must be growing as we step away from the center; therefore the maximum occurs at the border of the square, in one edge. 

Because of the symmetry of our function, one can understand that the values at the edges are the same, so the $4$ edges will have a point that maximizes the distance function. One can then use intuition to understand that the farther away from the two vertices of that edge, the better. If "intuition" is not good enough for you, one can then again use calculus. Let me know if you think it is needed.