\(S^2=x^2\left(1+y^2\right)+y^2\left(1+x^2\right)+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\)
\(\Rightarrow S^2=2x^2y^2+x^2+y^2+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\)
\(a^2=x^2y^2+\left(1+x^2\right)\left(1+y^2\right)+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\)
\(\Rightarrow a^2=2x^2y^2+x^2+y^2+1+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\)
\(\Rightarrow S^2=a^2-1\)
\(\Rightarrow S=\pm\sqrt{a^2-1}\)