解:因为a+b=3ab=-12(1)a^2+b^2=(a+b)^2-2ab=3^2-2*(-12)=9+24=33所以a^2+b^2=33(2)a^2-ab+b^2=(a^2+b^2)-ab=33+12=45(3)(a-b)^2=a^2+b^2-2ab=33+24=57