[tex](a-\sqrt3)^2=a^2-3\\a^2-2\sqrt3a+3=a^2-3\\2\sqrt3a=6\\\sqrt3 a=3\\a=\dfrac{3}{\sqrt3}=\dfrac{3\sqrt3}{3}=\sqrt3[/tex]