Finding distance from Local maximum of $f(x)=x+\sqrt{4x-x^2}$ to bisector of first quadrant 
What is the distance of the local maximum of the function
$f(x)=x+\sqrt{4x-x^2}$ to bisector of first quadrant?
$1)1\qquad\qquad2)\sqrt2\qquad\qquad3)2\qquad\qquad3)2\sqrt2$

It is a question from timed exam so the fastest answers are the best.
My approach:
First I realized the function defined for $x\in[0,4]$. to find local maximum I put derivative equal to zero :
$$f'(x)=1+\frac{4-2x}{2\sqrt{4x-x^2}}=0$$
$$x-2=\sqrt{4x-x^2}$$
$$2x^2-8x+4=0\rightarrow x^2-4x+2=0\rightarrow x=2\pm\sqrt2$$
From here I noticed that the quadratic $-x^2+4x$ is symmetric along $x=2$ line so after plugging $x=2\pm\sqrt2$ in the $\sqrt{4x-x^2}$, hence $f(x)$ is maximum for the value $x=2+\sqrt2$ and $f(2+\sqrt2)=2+\sqrt2+\sqrt{2}=2+2\sqrt2$
Now we should find the distance from the point $(2+\sqrt2,2+2\sqrt2)$ from the line $y=x$. Now by recognizing that $(2+\sqrt2,2+\sqrt2)$ is a point on the line $y=x$, I guess the distance might be $1$ and because it is the least value in the choices then I conclude it is the answer.
Is it possible to solve this problem quickly with other approaches?
 A: This is an arguably faster way of getting to the $x$-coordinate of the local maximum. $$f(x)=2+(x-2)+\sqrt{4-(x-2)^2} $$ Let $x-2 = 2\sin t$: $$f(t)= 2+2(\sin t +\cos t)= 2+2\sqrt 2\sin\left( t+\frac{\pi}{4} \right) $$ For a local maximum, $t=\frac{\pi}{4}$ (e.g.) for which $x=2+\sqrt 2$. And then you can do the same thing from here.
A: $x^2 - 4x + 4 = (x-2)^2$ is a perfect square, so rewrite $f(x)$ as $x + \sqrt{4 - (x-2)^2}$. We want to get $\sqrt{4 - 4 \cos^2 u} = 2 \sin u$ in the given domain, which leads to the parametrisation:
$$(x,y) = (2 + 2 \cos t, 2 + 2 \cos t + 2 \sin t).$$
Now $2 + 2 \cos t + 2 \sin t = 2(1 + \sqrt{2} \cos(t - \pi/4))$, which attains a maximum at $t = \frac{\pi}{4}$, thus:
$$x = 2 + 2 \cos \pi/4 = 2 + \sqrt{2}, y = 2(1 + \sqrt{2}).$$
A: That last part is good test-taking technique. Because the vertical distance to the line is $\sqrt{2}$, but that's not the shortest route, the only choice less than $\sqrt{2}$ must be right.
However, if you want to see why it's $1$, the easiest way is to draw the situation. $y = x$ makes a 45 degree angle with the vertical, so the perpendicular distance is the side length of a 45 degree right-triangle with hypotenuse $\sqrt{2}$, which is of course $1$.
A: Let $u$ be the maximum value of $f(x)$. Then:
$$\sqrt{4x-x^2} = u-x \Rightarrow 4x-x^2 = u^2 - 2ux + x^2$$
$$\Rightarrow 2x^2 - x(2u + 4) + u^2 = 0 \tag{*}$$
$$\Delta = 0 \Rightarrow (2u+4)^2-4(2)(u^2) = 0$$
$$\Rightarrow -4u^2+16u+16=0 \Rightarrow u^2 - 4u - 4 = 0$$
$$\Rightarrow u = 2 ± 2\sqrt{2}$$
hence the maximum value ($y$) is $2 + 2 \sqrt{2}$.
Since $\Delta = 0$, quadratic $(*)$ is a perfect square. Let this be $(ax-b)^2$: thus $b = 2 + 2 \sqrt{2}$ being the only constant term, and $a^2 = 2 \Rightarrow a = \sqrt{2}$ (concave up). Thus when $(ax-b)^2 = 0$, $\sqrt{2}x - (2 + 2\sqrt{2})=0 \Rightarrow x = \frac{\sqrt2 + 2 \sqrt{2}}{\sqrt{2}} = 2 + \sqrt{2}$.
