An invariant Φ of a tree T under a k-state Markov model, where the time parameter is identified with the edges of T, allows us to recognize whether data on N observed species can be associated with the N terminal vertices of T in the sense of having been generated on T rather than on any other tree with N terminals. The invariance is with respect to the (time) lengths associated with the edges of the tree. We propose a general method of finding invariants of a parametrized functional form. It involves calculating the probability f of all kN data possibilities for each of m edge-length configurations of T, then solving for the parameters using the m equations of form Φ (f) = 0. We apply this to the case of quadratic invariants for unrooted binary trees with four terminals, for all k, using the Jukes–Cantor type of Markov matrix. We report partial results on finding the smallest algebraically independent set of invariants.