solve equation involving fractions