The Hamilton-Jacobi equation and its complementary form