Using the distance formula,
AB=(at22−at12)2+(2at2−2at1)2
Factor each bracket.
at22−at12=a(t2−t1)(t2+t1),2at2−2at1=2a(t2−t1)
So
AB=a2(t2−t1)2(t2+t1)2+4a2(t2−t1)2
Take out the common factor a2(t2−t1)2.
AB=a2(t2−t1)2[(t2+t1)2+4]
AB=∣a∣∣t2−t1∣(t2+t1)2+4
(A distance cannot be negative, which is why the moduli appear; if a>0 and t2>t1 this is simply a(t2−t1)(t1+t2)2+4.)