Let $Z(P)=(P(X_1-X_2))^TP(X_1-X_2)$ If $K$ is viewed as depending only on $P$ and if you differentiate in direction $V$ you get $ D_V K = K*\frac{-1}{2} \left\{\frac{I-e^{-ad_{Z(P)}}}{ad_{Z(p)}} \left[ (V(X_1-X_2))^TP(X_1-X_2) + P(X_1-X_2)^TV(X_1-X_2) \right] \right\}$
The term on the right hand side in curly parenthesis needs explanation. It is the matrix valued function $\frac{I-e^{-ad_{Z(P)}}}{ad_{Z(P))}}$ applied to the term in square brackets. This in turn means
$\frac{I-e^{-ad_{Z}}}{ad_{Z}}[Y] = Y-\frac{[Z,Y]}{2!} + \frac{[Z,[Z,Y]]}{3!} - \ldots$
See, e.g., Chapter 3.3 in Brian C. Halls Book 'Lie Groups, Lie Algebras and Representations for a derivation of the derivative of the exponential.
(Sorry for posting a too simple and wrong answer first, which is true only if $Z$ and $D_VZ $ commute). (I don't like the $\frac{d}{dP}$ notation).