Systems of equations with substitution