5 Functions for algebraic tasks common to optimization problems