f'(t)=2(t((x_2-x_1)^2+(y_2-y_1)^2)-((x_2-x_1)(p-x_1)+(y_2-y_1)(q-y_1)))