<s>[INST] 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?
 [/INST] Let $$f(\theta)=\frac{2\sin\theta\cos\theta}{(\sin\theta+1)(\cos\theta+1)}=\frac{2\sin\theta\cos\theta}{1+\sin\theta+\cos\theta+\sin\theta\cos\theta}$$
Taking $\sin2\theta=t,\ t\in(0,1],$ $$f(t)=\frac t{1+\sqrt{1+t}+\frac t2}=\frac{2t}{2+2\sqrt{1+t}+t}=\frac2{\left(\frac 1t+\sqrt{\frac 1t+1}\right)^2}$$
In order to maximize the given function in the question one needs to find the minimum value of the denominator of the expression after the manipulations done in the image. The minimum value of denominator will be obtained at t=1 and it's easy to see that. Putting t=1 gives the maximum value of function to be $6-4\sqrt2$.
</s>