Extrema of $(1+\sin x)(1+\cos x)$ 
Find the extrema of $(1+\sin x)(1+\cos x)$ without using calculus.

I was able to figure out the minima by observing that each of the brackets range from $0$ to $2$. Therefore the minima has to be $0$ when either one of the brackets is zero.
However I couldnt figure out the maxima. I tried expanding it to complete the square but it didnt quite work out well.
Any hint is appreciated!
 A: Hint: $(1+\sin x)(1+\cos x)=1+\sin x+\cos x+\frac 12\sin 2x=1+\sqrt 2\sin(x+\frac {\pi}{4})+\frac 12\sin 2x$
A: $(1 + \sin x)(1+ \cos x)=1+\sin x + \cos x + \sin x \cos x.$
Note that $\sin x \cos x = \frac 12 \sin 2x.$
Note also that $\sin x + \cos x = \sqrt 2 \left ( \frac {\sqrt 2}{2} \sin x + \frac {\sqrt 2}{2} \cos x \right) = \sqrt 2 \left ( \cos \frac {\pi}{4} \sin x + \sin \frac{\pi}{4} \cos x \right )= \sqrt 2 \sin (x+ \frac{\pi}{4}).$
Both of these factors reach their maximum when $x=\frac{\pi}{4}$, so the maximum is $\frac 32 + \sqrt 2$.
A: We can also use the inequality
\begin{gather*}
AM\geq GM\\
So,\ \\
\sqrt{( 1+\sin x)( 1+\cos x)} \leq \frac{1+\sin x+1+\cos x}{2}\\
Now,\ the\ function\ on\ the\ RHS\ is\\
1+\frac{\sin x+\cos x}{2} =1+\frac{1}{\sqrt{2}}\sin\left( x+\frac{\pi }{4}\right)\\
The\ maxima\ of\ this\ function\ is\ 1+\frac{1}{\sqrt{2}} ,\\
because\ maximum\ value\ of\ \sin\left( x+\frac{\pi }{4}\right) =1\\
\sqrt{( 1+\sin x)( 1+\cos x)} \leq 1+\frac{1}{\sqrt{2}}\\
( 1+\sin x)( 1+\cos x) \leq \left( 1+\frac{1}{\sqrt{2}}\right)^{2} =\frac{3+2\sqrt{2}}{2} =\frac{3}{2} +\sqrt{2}
\end{gather*}
A: Note
\begin{align}
A&=(1+\sin x)(1+\cos x)\\
&= 1+\sin x+ \cos x+ \frac12\sin2x\\
 &= 1+\sqrt2 \cos(\frac\pi4-x)+ \frac12\cos(\frac\pi2-2x)\\
&= \frac12+\sqrt2 \cos(\frac\pi4-x)+ \cos^2(\frac\pi4-x)\\
&= \left( \cos(\frac\pi4 -x) + \frac1{\sqrt2}\right)^2
\end{align}
Thus
$$0\le A \le (1+\frac1{\sqrt2})^2$$
