a^2+b^2-2a+4b+5=0(a-1)²+(b+2)²=0a-1=0 b+2=0a=1 b= -2a+b= 1+(-2)= -1
(a-1)²+(b+2)²=0得a=1b=-2所以a+b=1-2=-1
a^2+b^2-2a+4b+5=a^2-2a+1+b^2+4b+4=(a-1)^2+(b+2)^2=0所以a=1,b=-2所以a+b=-1
此式化简为(a-1)^2+(b+2)^2=0得 a=1,b=-2,所以a+b=-1