这貌似要推导出 “ 韦达定理” 的求根公式.以下用配方法解题.
a x ² + b x + c = 0
a(x ² + (b / a) x + c / a)= 0
x ² + (b / a)x + (b / 2 a)² = - c / a + (b / 2 a)²
(x + b / 2 a)² = - c / a + b ² / 4 a ²
(x + b / 2 a)² = (b ² - 4 a c)/ 4 a ²
x + b / 2 a = ± √(b ² - 4 a c)/ 2 a
x = ±(√(b ² - 4 a c)- b)/ 2 a
x1 = (- b + √(b ² - 4 a c))/ 2 a
x2 = (- b - √(b ² - 4 a c))/ 2 a