Find the sum of the squares of the solutions to $\sqrt{1-\mathrm{cos}x}+\sqrt{1+\mathrm{cos}x}=\sqrt{3},$, where $-\pi <x<\pi .$

Attempt: Squaring both sides gives

$1-\mathrm{cos}x+2\sqrt{(1-\mathrm{cos}x)(1+\mathrm{cos}x)}+1+\mathrm{cos}x=3,$

which simplifies to

$2\sqrt{1-{\mathrm{cos}}^{2}x}=3-1\u27fa\sqrt{{\mathrm{sin}}^{2}x}=1\u27fa|\mathrm{sin}x|=1.$

Attempt: Squaring both sides gives

$1-\mathrm{cos}x+2\sqrt{(1-\mathrm{cos}x)(1+\mathrm{cos}x)}+1+\mathrm{cos}x=3,$

which simplifies to

$2\sqrt{1-{\mathrm{cos}}^{2}x}=3-1\u27fa\sqrt{{\mathrm{sin}}^{2}x}=1\u27fa|\mathrm{sin}x|=1.$