根据韦达定理,得
x1+x2=a
x1*x2=2a-1
则有
x1^2+x2^2
=(x1+x2)²-2x1*x2
=a²-4a+2
=7
即a²-4a-5=0
(a+1)(a-5)=0
a=-1或者a=5
当a=-1时,
原方程为:x^2+x-3=0
△=1-4*(-3)=13
当a=5时,
原方程为:x^2-5x+9=0
△=(-5)²-4*9=-11<0
不满足题意。
所以a=-1.
原方程为:x^2+x-3=0
x1+x2=-1
x1*x2=-3
(x1-x2)^2
=x1^2+x2^2-2x1*x2
=7-2*(-3)
=13