Solve a system of equations using substitution