That is, $A$ is in the second quadrant and $B$ is in the fourth quadrant.
We know that in the second quadrant, $\sin e$ function is positive and $\cos$ ine and tan functions are negative.
In the fourth quadran $t, \sin e$ and tan functions are negative and $\cos i n e$ function is positive.
Therefore,
$\cos A=-\sqrt{1-\sin ^{2} A}=-\sqrt{1-\left(\frac{1}{2}\right)^{2}}=-\sqrt{1-\frac{1}{4}}=-\sqrt{\frac{3}{4}}=\frac{-\sqrt{3}}{2}$
$\tan A=\frac{\sin A}{\cos A}=\frac{1 / 2}{-\sqrt{3} / 2}=\frac{-1}{\sqrt{3}}$
$\sin B=-\sqrt{1-\cos ^{2} B}=-\sqrt{1-\left(\frac{12}{13}\right)^{2}}=-\sqrt{1-\frac{144}{169}}=-\sqrt{\frac{25}{169}}=\frac{-5}{13}$
$\tan B=\frac{\sin B}{\cos B}=\frac{-5 / 13}{12 / 13}=\frac{-5}{12}$
$=\frac{\frac{-1}{\sqrt{3}}-\frac{-5}{12}}{1+\frac{-1}{\sqrt{3}} \times \frac{-5}{12}}$
$=\frac{\frac{-12+5 \sqrt{3}}{12 \sqrt{3}}}{\frac{12 \sqrt{3}+5}{12 \sqrt{3}}}=\frac{5 \sqrt{3}-12}{5+12 \sqrt{3}}$