Example 7 In the sequence $\left\{a_{n}\right\}$, $a_{1}=\sqrt{2}, a_{n+1}=$ $\sqrt{2+a_{n}}(n \geqslant 1)$. Then $a_{n}=$ $\qquad$ .
Solution: In the sequence $\left\{a_{n}\right\}$, $a_{1}=\sqrt{2}=2 \cos \theta$, where $\theta=\frac{\pi}{4}$. From the known recurrence relation and trigonometric formulas, we get
$$
a_{2}=2 \cos \frac{\theta}{2}, a_{3}=2 \cos \frac{\theta}{2^{2}} \text {. }
$$

Conjecture $a_{n}=2 \cos \frac{\theta}{2^{n-1}}$, and prove it by mathematical induction (omitted).