3ab+7ba+2b
7ba is the same as 7ab, so therefore 3ab and 7ba are like terms.
=10ab +2b
If you are then asked to factorize:
that out the highest common factor (2b) so;
= 2b(5a+1)