solve expressions with two variables