TITLE: Understanding inequalities and how not to blindly apply famous inequalities
QUESTION [5 upvotes]: If $x \in (0, \pi/2)$, prove that
$$ 2 (\sin x )^{(1-\sin x)} \cdot (1-\sin x)^{\sin x} \leq 1 $$

Attempt:
We use Youngs inequality: if $\alpha+\beta = 1$ and $x,y $ are positive, then $x^{\alpha} + y^{\beta} \leq \alpha x + \beta y $.
In our problem, both $\sin x$ and $1 - \sin x$ are positive thus,
$$ 2 (\sin x )^{(1-\sin x)} \cdot (1-\sin x)^{\sin x} \leq 4(1 - \sin x) \sin x   \;\;\;\;\;\;\; (*)$$
If I let $f(x) = 4 (1-\sin x) \sin x$ then $f'(x)=0$ implies that $x= \pi/6$ is a max and since $f(\pi/6) = 1/4$, we are done.
Is this a correct argument?
MY question is: We could have also use the AM-GM inequality in (*) to obtain that
$$ f(x) \leq 8 ( (1-\sin x)^2 + \sin^2 x ) $$
But this would us lead us nowhere since the above is bounded above by $40$. Why does the AM-GM inequality gives such large bound for $f(x)$? How do we know when to apply AM-GM inequality properly?

REPLY [2 votes]: Your first solution is correct. It becomes a bit simpler to read with the substitution $u = \sin(x) \in (0, 1)$:
$$
 2u^{1-u} (1-u)^u \le 4 u(1-u) \le 1 \, .
$$
The first estimate is Young's inequality (as you noticed), this is also a special case of the Weighted AM–GM inequality.
For the second estimate you determined the maximum by computing the derivative, but actually it is just the AM-GM inequality: $\sqrt{u(1-u)} \le \frac{u + (1-u)}{2}$.
Since equality holds for $u=1/2$ (corresponding to $x = \pi/6$) the inequality is sharp.

Your second approach has two errors: First, AM-GM in the form $2ab \le a^2 + b^2$ gives
$$
 4 u (1-u) \le 2 \left( (1-u)^2 + u^2 \right)
$$
with the factor $2$ on the right-hand side, not $8$. Second, you did not consider that $0 \le u = \sin(x) \le 1$. In this range we have 
$$
 2 \left( (1-u)^2 + u^2 \right) = 4 \left( u - \frac 12 \right)^2 + 1 \le 2 
$$
with equality for $u=0$ and $u=1$. This gives the  estimate
$$
 4 u (1-u) \le 2 \left( (1-u)^2 + u^2 \right) \le 2
$$
which is better than your result but not sharp, because equality cannot hold simultaneously in both estimates.
Generally, when applying multiple inequalities, it is good to keep track of when equality holds. The end result is only sharp when equality can hold in all estimates simultaneously.