By first expanding \(( \cos \theta + \sin \theta ) ^ { 2 }\), find the three solutions of the equation
$$( \cos \theta + \sin \theta ) ^ { 2 } = 1$$
for \(0 \leqslant \theta \leqslant \pi\).
Hence verify that the only solutions of the equation \(\cos \theta + \sin \theta = 1\) for \(0 \leqslant \theta \leqslant \pi\) are 0 and \(\frac { 1 } { 2 } \pi\).