am-bm+an-bn
Group the first two terms and the last two terms.
(am-bm)+an-bn
Factor out the greatest common factor (GCF) from each group.
m(a-b)+n(a-b)
m(a-b)+n(a-b)
Factor the polynomial by factoring out the greatest common factor, a-b.
(a-b)(m+n)
Factor am-bm+an-bn