Solving equations using division method