This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] Let $y=\sqrt{8x-x^2-12}$, so $(x-4)^2+y^2=4$ with $y\ge0$: the upper semicircle with centre $(4,0)$, radius $2$. The expression is the squared distance from $(x,y)$ to $(7,4)$. The nearest point on the circle lies on the line from $(7,4)$ to the centre, at $(5.2,1.6)$ (upper half): $m=(5-2)^2=9$. The farthest circle point is in the lower half, so on the upper semicircle the maximum is at an endpoint: $(2,0)$ gives $25+16=41$ and $(6,0)$ gives $1+16=17$, so $M=41$. $M^2-m^2=1681-81=1600$. Answer: 1600.