How to find the maximum value of $\frac{2\sin\theta\cos\theta}{(1+\cos\theta)(1+\sin\theta)}$? Let $\theta\in\left(0,\frac{\pi}{2}\right)$, then find the maximum value of $\dfrac{2\sin\theta\cos\theta}{(1+\cos\theta)(1+\sin\theta)}$
I found the derivative, which is equal to $\dfrac{(\cos\theta−\sin\theta)(\sin\theta+\cos\theta+1)^2}{(1+\sin\theta+\cos\theta+\sin\theta\cos\theta)^2}$
But there were complicated calculations involved. Is there a simpler way to find the maximum of this function?


Step 1: Find the critical points of $f(\theta)$:

For this, it is necessary to find the derivative of the function and do $f'(\theta)=0$, such that:
\begin{align*}
    f'(\theta)=&-\dfrac{2\cos^2\theta\sin\theta}{(cos\theta+1)(\sin\theta+1)^2} +\\
               &+\dfrac{2\cos^2\theta}{(\cos\theta+1)(sin\theta+1)}+ \\
               &+\dfrac{2\cos\theta\sin^2\theta}{(\cos\theta+1)^2(\sin\theta+1)} -\\
               &-\dfrac{2\sin^2\theta}{(\cos\theta+1)(\sin\theta+1)}=0
\end{align*}
We can rewrite this:
\begin{equation}
     f'(x)=\dfrac{2(\cos\theta-\sin\theta)(\cos\theta+\cos^2\theta+\sin\theta+\cos\theta\sin\theta+\sin^2\theta)}{(\cos\theta+1)^2(\sin\theta+1)^2}=0
\end{equation}
dividing by 2 both sides and reduce trigonometric functions:
\begin{equation}
     \dfrac{3\cos\theta+4\cos(2\theta)+\cos(3\theta)-3\sin\theta +\sin(3\theta)}{4(\cos\theta+1)^2(\sin\theta+1)^2}=0
\end{equation}
multiplying both sides by 4 and assuming $(\cos\theta+1)\neq 0$ and $(\sin\theta+1)\neq 0$, we can treat the problem in another way, such that:
\begin{equation}
     3\cos\theta+4\cos(2\theta)+\cos(3\theta)-3\sin\theta +\sin(3\theta)=0
\end{equation}
Show that this equation is equal to:
\begin{equation}
     16\sqrt{2}\cos^2\left(\dfrac{\theta}{2}\right)\sin\left(-\theta+\dfrac{\pi}{4}\right)\sin^2\left( \dfrac{\theta}{2}+\dfrac{\pi}{4} \right)
\end{equation}
This implies that:
\begin{equation}
     \cos^2\left(\dfrac{\theta}{2}\right)\sin\left(-\theta+\dfrac{\pi}{4}\right)\sin^2\left( \dfrac{\theta}{2}+\dfrac{\pi}{4} \right)=0
\end{equation}
We have 3 possibilities:
\begin{align}
      \cos^2\left(\dfrac{\theta}{2}\right)&=0 \\
      \sin\left(-\theta+\dfrac{\pi}{4}\right)&=0 \\
      \sin^2\left( \dfrac{\theta}{2}+\dfrac{\pi}{4} \right)&=0
\end{align}
Solving this 3 equations, you find that:
$$\theta=\dfrac{\pi}{4}$$

Step 2: Determine the endpoints of the domain of $f(\theta)$

For $\theta=0^+$ and $\theta=\dfrac{\pi}{2}^{-}$, we have $f(\theta)=0$, this implies:
$$\fbox{$f\left(\dfrac{\pi}{4}\right)=6-4\sqrt{2}$}$$
Is the global maximum of $f(\theta)$.
