What is the maximum of $\ 2(a+b)-ab$ if we have: $\ a^2+b^2=8\ (a,b\ real)$ What is the maximum of $\quad 2(a+b)-ab\ $ if we have: $a^2+b^2=8 \ (a,b\ real)  $
My work is as follows:
According to AM-GM inequality:
     $$\frac{a^2+b^2}2\ge\sqrt{a^2b^2} \Rightarrow $$
     $$ab\le4 $$
On the other hand , from  $\ a^2+b^2=8\ ,\  $we have:  $\ 2(a+b)-ab=2\sqrt{8+2ab}-ab$
We can get this:  $$2\sqrt{8+2ab}\le8$$
Is it possible to somehow combine these two inequalities to find the maximum value of $\ 2(a+b)-ab$ ?
I think in this solution technique we must find the minimum value of $ab\ $ , but how???

Another, easier method(without trigonometry and differentiation):
$$a^2+b^2 = (a + b)^2 - 2ab = 8 \rightarrow ab=\frac{(a + b)^2}{2} - 4$$
Substitute in your expression. Now you have to find the maximum of the following:
$$2(a + b) - \frac{(a + b)^2}{2} + 4$$Let $t = a + b$. Since $a, b$ are arbitrary reals, then $t$ is also arbitrary real.
$$f(t) = -\frac{1}{2}t^2 + 2t + 4$$
$f(t)$ is a quadratic function, since the coefficient before $t^2$ is negative, the parabola is turned downwards. Its vertex is $t_0 = -\frac{b}{2a} = 2$, hence f(t) attains maximum value when $t = 2$ and that value is $$f(2) = 6$$
