Linear and quadratic systems of equations