TITLE: Find the maximum value of the $f(x) = \sqrt {8x - x^2} - \sqrt {14x - x^2 - 48}$.
QUESTION [6 upvotes]: The largest value of the function $f(x) = \sqrt {8x - x^2} - \sqrt {14x - x^2 - 48}$ is written in the format $"m \sqrt n"$. Find $m + n$.
My attempt:
A traditionalway would be to differentiate the function w.r.t. $x$ and equate it to $0$.
$$f'(x) = \frac {8 - 2x}{\sqrt {8x - x^2}} - \frac {14 - 2x}{\sqrt {14x - x^2 - 48}}$$
From here, I concluded that : $6 < x < 8$
Equation $f'(x)$ to $0$, I get $x = 6.4$. But that is not the answer. Answer is indeed $x = 6$ and thus $m+n = 5$. (m and n are integers)
My first doubt is $6$ gives $f'(x)$ as '$- \infty$', which is not a maxima or minima because we know that slope of any curve at maxima or minima is $0$ and thus $f'(x)$ should be $0$.
Second is that even if we suppose that $6$ is the answer, why was $6.4$ not taken as the answer.

REPLY [4 votes]: The domain of the function is $6\le x \le 8$. With derivative you obtain max and min in $(6,8)$ but then you must calculate the function on the boudaries. In this case $x=6,4$ is a local point where $f'(x)=0$ but it is not the max because $f(6)>f(6,4)$.
$f(6)=\sqrt 12 = 2\sqrt3$ and $2+3=5$.
The function in $x=6$ is defined but its slope is infinite (tangent line in $x=6$ is vertical and you can think the angular coefficient as infinite).

REPLY [2 votes]: Way better Solution
Let's consider the two circles 
$$(x-4)^2+y^2 = 16$$ $$(x-7)^2 + y^2 = 1$$
We need to find the maximum $y$ displacement possible for a given $x$ between these two, which would occur at $x = 6$ as obvious from drawing these circles
From the geometry, you can also deduce the range of x for which you will get a real output. As one can see, only for $6 \le x \le 8$ does the function actually return a value of $y$, as the smaller circle only extends that much