solve a * (a + x)/2 = a^2/2 + (a(a - x)/2) * (a^2 / (a^2 + (a - x)^2)) for x