Let's say I have the following quadratic equation
$$ (x - a_1)^2 + (x - a_2)^2 + \dots + (x - a_n)^2 = b $$
This will have $2$ solutions (complex solutions are valid). One could expand that out, collect the terms and then use the quadratic formula. Is there a way to solve this directly without rewriting everything?
Note this is the equation 2.6 in Zhao's fast sweeping paper.