解一元二次方程组

解方程
a x 2 + b x + c = 0 ax^2+bx+c=0 ax2+bx+c=0

解:

a x 2 + b x = − c ax^2+bx=-c ax2+bx=c

4 a 2 x 2 + 4 a b x = − 4 a c 4a^2x^2+4abx=-4ac 4a2x2+4abx=4ac

4 a 2 x 2 + 4 a b x + b 2 = − 4 a c + b 2 4a^2x^2+4abx+b^2=-4ac+b^2 4a2x2+4abx+b2=4ac+b2

( 2 a x + b ) 2 = − 4 a c + b 2 (2ax+b)^2=-4ac+b^2 (2ax+b)2=4ac+b2

2 a x + b = ± − 4 a c + b 2 2ax+b=\pm \sqrt {-4ac+b^2} 2ax+b=±4ac+b2

2 a x = ± b 2 − 4 a c − b 2ax=\pm \sqrt {b^2-4ac} - b 2ax=±b24ac b

解得:
x 1 , 2 = − b ± b 2 − 4 a c 2 a 或 x 2 , 1 = 2 c − b ± b 2 − 4 a c x_{1,2}=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}\quad或\quad x_{2,1}=\dfrac{2c}{-b\pm\sqrt{b^2-4ac}} x1,2=2ab±b24ac x2,1=b±b24ac 2c

你可能感兴趣的:(算法,数学)