Example 15 Find the sum $S_{n}=\frac{\sin \theta}{\cos 2 \theta+\cos \theta}+\frac{\sin 2 \theta}{\cos 4 \theta+\cos \theta}+\cdots+\frac{\sin n \theta}{\cos 2 n \theta+\cos \theta}$
Solve $S_{n}=\frac{\sin \theta}{2 \cos \frac{3 \theta}{2} \cos \frac{\theta}{2}}+\frac{\sin 2 \theta}{2 \cos \frac{5 \theta}{2} \cos \frac{3 \theta}{2}}+\cdots+\frac{\sin n \theta}{2 \cos \frac{2 n+1}{2} \theta \cos \frac{2 n-1}{2} \theta}$.
When $\sin \frac{\theta}{2} \neq 0$,
\[
\begin{aligned}
\sin \frac{\theta}{2} \cdot S_{n} & =\frac{\sin \theta \cdot \sin \frac{\theta}{2}}{2 \cos \frac{3 \theta}{2} \cos \frac{\theta}{2}}+\frac{\sin 2 \theta \cdot \sin \frac{\theta}{2}}{2 \cos \frac{5 \theta}{2} \cos \frac{3 \theta}{2}}+\frac{\sin n \theta \cdot \sin \frac{\theta}{2}}{2 \cos \frac{2 n+1}{2} \theta \cdot \cos \frac{2 n-1}{2} \theta} \\
& =\frac{\cos \frac{\theta}{2}-\cos \frac{3 \theta}{2}}{4 \cos \frac{3 \theta}{2} \cos \frac{\theta}{2}}+\frac{\cos \frac{3 \theta}{2}-\cos \frac{5 \theta}{2}}{4 \cos \frac{5 \theta}{2} \cos \frac{3 \theta}{2}}+\cdots+\frac{\cos \frac{2 n-1}{2} \theta-\cos \frac{2 n+1}{2} \theta}{4 \cos \frac{2 n+1}{2} \theta \cos \frac{2 n-1}{2} \theta} \\
& =\frac{1}{4}\left[\left(\frac{1}{\cos \frac{3 \theta}{2}}-\frac{1}{\cos \frac{\theta}{2}}\right)+\left(\frac{1}{\cos \frac{5 \theta}{2}}-\frac{1}{\cos \frac{3 \theta}{2}}\right)+\cdots+\left(\frac{1}{\cos \frac{2 n+1}{2} \theta}-\frac{1}{\cos \frac{2 n-1}{2}} \theta\right)\right] \\
& =\frac{1}{4}\left(\frac{1}{\cos \frac{2 n+1}{2}}-\frac{1}{\cos \frac{\theta}{2}}\right) .
\end{aligned}
\]

Thus, $S_{n}=\frac{1}{4 \sin \frac{\theta}{2}}\left(\frac{1}{\cos \frac{2 n+1}{2} \theta}-\frac{1}{\cos \frac{\theta}{2}}\right)$.
When $\sin \frac{\theta}{2}=0$, $S_{n}=0$.