Two Lagrange-like optical invariants and some applications