Example 1
(1) Find the maximum value of the function $f(\theta)=\cos \frac{\theta}{2} \sin \theta, \theta \in\left(0, \frac{\pi}{2}\right)$;
(2) Find the maximum value of the function $g(\theta)=\sin \frac{\theta}{2} \cos \theta, \theta \in\left(0, \frac{\pi}{2}\right)$.