in that example you need distribute / over + and -, then sort out constants for each variable, you'd need a parser though and a reduction engine