I have in mind $$\max\left( \sqrt{(x-1) (y-x)}+\sqrt{(1-x) (7-y)}+\sqrt{(y-7) (x-y)}\right)$$ for $x\geq -2\land x\leq 3\land y\geq 0\land y\leq 11 $, of course, taking into account real values of the roots only. In order to avoid complex numbers I consider
f=(Sqrt[(x - 1)*(y - x)] + Sqrt[(7 - y)*(1 - x)] + Sqrt[(x - y)*(y - 7)])*
Boole[(x - 1)*(y - x) >= 0]* Boole[(7 - y)*(1 - x) >= 0]*Boole[(x - y)*(y - 7) >= 0]
Unfortunately, its plot does not give any prompt to me.
Plot3D[f, {x, -2, 3}, {y, 0, 11}]
Both
NMaximize[{f, x >= -2 && x <= 3 && y >= 0 && y <= 11},{x, y},AccuracyGoal-> 3,MaxIterations->200]
NMaximize::cvmit: Failed to converge to the requested accuracy or precision within 200 iterations. {0., {x -> 3., y -> 11.}}
and
FindMaximum[{f, x >= -2 && x <= 3 && y >= 0 && y <= 11}, {x, y}]
{0., {x -> 0.914707, y -> 9.31719}}
do not produce a correct answer in view of
f /. {x -> 1, y -> 3}
$ 2 \sqrt{2}$