Example 5 Let $0<\theta<\pi$, find the maximum value of $y=\sin \frac{\theta}{2}(1+\cos \theta)$.
Analysis: Eliminate the trigonometric function through substitution.
Let $\sin \frac{\theta}{2}=x, x \in(0,1)$, then
$$y=2 \sin \frac{\theta}{2}\left(1-\sin ^{2} \frac{\theta}{2}\right)=2 x\left(1-x^{2}\right)$$

Transforming, we get
$$\begin{aligned}
1 & =x^{2}+\frac{y}{2 x} \\
& =x^{2}+\frac{y}{4 x}+\frac{y}{4 x} \\
& \geqslant 3 \sqrt[3]{x^{2} \cdot \frac{y}{4 x} \cdot \frac{y}{4 x}}=3 \sqrt[3]{\frac{y^{2}}{16}},
\end{aligned}$$
$\therefore y^{2} \leqslant \frac{16}{27}$, i.e., when $\sin \frac{\theta}{2}=\frac{\sqrt{3}}{3}$, $y_{\text {max }}=\frac{4 \sqrt{3}}{9}$.