Let's assume we have a 2d vector $\vec{x}=\begin{pmatrix} a \\ b \end{pmatrix}$. The square of it's length is easily computed as $ |x|^2 = a^2 + b^2 $
Also note that always $|x|^2 \geq 0$. So to compute $|x|$ we can simply factorize by taking the square root
$ |x|^2 = a^2 + b^2 = \sqrt{a^2 + b^2}\sqrt{a^2 + b^2} $
However sometimes I see people factorizing this sum of squares using complex numbers like
$ a^2 + b^2 = (a + i b)(a - i b) $
But what is the point of introducing complex numbers here? The sum of squares is by definition a positive number. So taking the square root is always a valid operation. Isn't this a completely unnecessary use of complex numbers? Or am I overlooking something here? Is there some advantage in using the factorization with complex numbers?