Each term in the numerator and the denominator is divisible by 3ax.
[(3ax)a - (3ax)2x + (3ax)8ax]/[(3ax)4ax]
[(3ax)(a - 2x + 8ax)]/[(3ax)(4ax)]
factoring out the term common to both the numerator and the denominator leaves
(a - 2x + 8ax)/4ax