We know that, A is in second quadrant, B is in fourth quadrant.
In the second quadrant, sine function is positive, cosine and tan functions are negative.
In the fourth quadrant, sine and tan functions are negative, cosine function is positive.
By using the formulas,
cos A = – √(1 – sin2 A) and sin B = -√(1 – cos2 B)
So let us find the value of cos A and sin B
cos A = – √(1 – sin2 A)
= – √(1 – (1/2)2)
= – √(1- 1/4)
= – √((4-1)/4)
= – √(3/4)
= -√3/2
sin B = -√(1 – cos2 B)
= – √(1-(12/13)2)
= – √(1- 144/169)
= – √((169-144)/169)
= – √(25/169)
= – 5/13
We know, tan A = sin A / cos A and tan B = sin B / cos B
tan A = (1/2)/( -√3/2) = -1/√3 and
tan B = (-5/13)/(12/13) = -5/12
So, tan (A – B) = (tan A – tan B) / (1 + tan A tan B)
= ((-1/√3) – (-5/12)) / (1 + (-1/√3) × (-5/12))
= ((-12+5√3)/12√3) / (1 + 5/12√3)
= ((-12+5√3)/12√3) / ((12√3 + 5)/12√3)
= (5√3 – 12) / (5 + 12√3)