Y by siavosh, Adventure10, Mango247
A quick solution:
Let R be the foot of the perpend. from X to BC. Let's assume Q and R are in the interior of the segms AC and BC (respectively) and P in the ext of AD. P, R, Q are colinear (Simson's thm). PQ tangent to circle XRD iff XRQ=XDR iff Pi-XCA=XDR iff XBA=XDR=XDC=ADB iff XBC+ABC=ADB=DAC+ACB iff XAC+ABC=DAC+ACD iff ABC=ACD=ACB iff AB=AC. It's the same for all the other cases.
Let R be the foot of the perpend. from X to BC. Let's assume Q and R are in the interior of the segms AC and BC (respectively) and P in the ext of AD. P, R, Q are colinear (Simson's thm). PQ tangent to circle XRD iff XRQ=XDR iff Pi-XCA=XDR iff XBA=XDR=XDC=ADB iff XBC+ABC=ADB=DAC+ACB iff XAC+ABC=DAC+ACD iff ABC=ACD=ACB iff AB=AC. It's the same for all the other cases.