a^2b^2+a^2+b^2+1=4ab
((ab)^2-2ab+1)+(a^2-2ab+b^2)=0
(ab-1)^2+(a-b)^2=0
therefore,
ab-1=0 and a-b=0
ab=1 and a=b
a=b=1 or a=b=-1
When a=1,a^2-3a+1=-1
when a=-1,a^2-3a+1=5
a^2b^2+a^2+b^2+1=4ab
((ab)^2-2ab+1)+(a^2-2ab+b^2)=0
(ab-1)^2+(a-b)^2=0
therefore,
ab-1=0 and a-b=0
ab=1 and a=b
a=b=1 or a=b=-1
When a=1,a^2-3a+1=-1
when a=-1,a^2-3a+1=5