The trace identity and the quadratic-form identity are all simple and powerful tools for establishing Hamiltonian structure of integrable hierarchies of soliton equations, the constant γ contained in the two identities are all to be determined. It has been a left problem to seek for computing formulas on γ, which had been specially proposed by Tu [Tu Guizhang. The trace identity, a powerful tool for constructing the Hamiltonian structure of integrable systems. J Math Phys 1989;30(2):330–8]. In this paper, we create an efficient method for obtaining γ by making use of two procedures. First, a few quadratic expressions G(V)’s are discovered from the solvable conditions on Λ, where Λ satisfies the equation [Λ,V]-Vλ=γλV, whereas, G(V) and γ have the clear relations. Second, by means of Vx=[U,V], we prove that G(V) is an one-place function with aspect to λ, but not related to x. It follows from the above two steps that the formula γ=-λ2ddλln|G(V)| is obtained. This technique is verified to be feasible and efficient by applying it to a few examples.