Two systems of mathematical physics are defined by us, which are the first-order differential system (FODS) and the second-order differential system (SODS). Basing on the conventional Legendre transformation, we obtain a new kind of canonical equations of Hamilton (CEH) with some kind of symmetry. We show that the FODS can only be expressed by the new CEH, but do not by the conventional CEH, while the SODS can be done by both the new and the conventional CEHs, on basis of the same conventional Legendre transformation. As an example, we prove that the nonlinear Schrödinger equation can be expressed with the new CEH in a consistent way. Based on the new CEH, the approximate soliton solution of the nonlocal nonlinear Schrödinger equation is obtained, and the soliton stability is analysed analytically as well. Furthermore, because the symmetry of a system is closely connected with certain conservation theorem of the system, the new CEH may be useful in some complicated systems when the symmetry considerations are used.