Solve equations for a given variable