\(b^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)}\)
\(=x^2+y^2+2x^2y^2+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\)
\(=x^2+y^2+x^2y^2+1+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}+x^2y^2-1\)
\(=\left(1+x^2\right)\left(1+y^2\right)+2xy\sqrt{\left(1+x^2\right)\left(1+y^2\right)}+x^2y^2-1\)
\(=\left(xy+\sqrt{\left(1+x^2\right)\left(1+y^2\right)}\right)^2-1\)
\(=a^2-1\Rightarrow b=\sqrt{a^2-1}\)