(a+1)^2-(3a^2+4ab+4b^2+2)
=a^2+2a+1-3a^2-4ab-4b^2-2
=-2a^2+2a-1-4ab-4b^2=0
所以2a^2-2a+1+4ab+4b^2=0
(a^2-2a+1)+(a^2+4ab+4b^2)=0
(a-1)^2+(a+2b)^2=0
因为(a-1)^2>=0,(a+2b)^2>=0
所以a-1=0,a+2b=0
a=1,b=-1/2
(a+1)^2-(3a^2+4ab+4b^2+2)
=a^2+2a+1-3a^2-4ab-4b^2-2
=-2a^2+2a-1-4ab-4b^2=0
所以2a^2-2a+1+4ab+4b^2=0
(a^2-2a+1)+(a^2+4ab+4b^2)=0
(a-1)^2+(a+2b)^2=0
因为(a-1)^2>=0,(a+2b)^2>=0
所以a-1=0,a+2b=0
a=1,b=-1/2