Here's another way to explain how they came up with H(x, y).
In the first screen shot of the OP, the author found that ##H(x, y) = x^2 - xy + \xi_1(y)## and that ##H(x, y) = -xy + \frac{y^2}2 + x^2y + \xi_2(x)##. The ##\xi_i## functions are functions of a single variable only.
Since the 2nd version of H(x, y) contains a term in y alone, namely ##\frac{y^2}2##, this means that ##\xi_1(y) = \frac{y^2}2##. Also, since the 1st version of H contains no term in x alone, this means that ##\xi_2(x) = 0##. After all, both versions of H(x, y) must be the same.
Hence ##H(x, y) = x^2y - xy + \frac{y^2}2##
The differential equation that was derived from the original pair of equations (that involved t) is ##(2xy - y)dx +(-x + y + x^2)dy = 0##. This can be seen as ##\frac{\partial H(x, y)}{\partial x}dx + \frac{\partial H(x, y)}{\partial y} dy = 0##.
The LHS of the last equation is the total differential of H(x, y). Since the total differential is zero, it must be true that H(x, y) = c, a constant.
BTW, the thread title is misleading, since the equation you're dealing with is exact, not inexact.