Example 9 Let $\sin \alpha + \cos \alpha = a (0 \leqslant a \leqslant \sqrt{2})$. Find the expression for $\sin ^{n} \alpha + \cos ^{n} \alpha$ in terms of $a$.
(2005, Fudan University Independent Admission Examination)
Given $\sin \alpha + \cos \alpha = a$
$$
\Rightarrow \sin \alpha \cdot \cos \alpha = \frac{a^2 - 1}{2}
$$
$\Rightarrow \sin \alpha, \cos \alpha$ are the roots of the equation $t^2 - a t + \frac{a^2 - 1}{2} = 0$
$$
\Rightarrow \sin \alpha = \frac{a + \sqrt{2 - a^2}}{2}, \cos \alpha = \frac{a - \sqrt{2 - a^2}}{2}
$$
(can be exchanged)
$$
\begin{aligned}
\Rightarrow & \sin^n \alpha + \cos^n \alpha \\
& = \left( \frac{a + \sqrt{2 - a^2}}{2} \right)^n + \left( \frac{a - \sqrt{2 - a^2}}{2} \right)^n .
\end{aligned}
$$