math formulation