What maximum area of a square inserted within a region limited by certain functions?
The problem is relatively easy when we calculate the maximum area of a square inserted within a region defined, for example, by a parabola $f(x)$ and the x-axis, as shown in the graph below:

In this case the limited region is defined by all $R(x, y)$ such that $y \geqslant 0$ and $y \leqslant f(x)$, with $f(x) = p(x-x_0)(x-x_1)$ and $p \lt 0$.
$A_{max}$ is maximum when also $a$ is maximum: $A_{max} = a^2_{max}$.
But the problem here is more complex: How to determine the maximum area of a square inserted in a region limited by 3 functions (curves or straight lines)? The graph below illustrates an example of a region limited by functions $f, g, h$:

Suposing that $f(x) = -2x + 20$, $g(x) = x^2 - 10x + 30$, and $h(x) = -\frac{x^2}{5} + 4x$, and all $P(x,y)$ belongs to Region defined by:
- $y \geqslant f(x)$
- $y \geqslant g(x)$
- $y \leqslant h(x)$
Note that the vertices of the square do not necessarily have to belong to the curves!
Determine a method for finding $A_{max}$.
This link is a spectacular video that didactically shows a similar problem. It appears to be an unresolved topology problem: https://www.youtube.com/watch?v=AmgkSdhK4K8
See also the link for a similar problem that asks what the largest number of squares with defined sides can be compacted in a given region: What is the maximum number of squares we can compact within a defined area?