solve ax=b for x