(i) ax+bx+ay+by=(ax+bx)+(ay+by) [Grouping the terms]
=(a+b)x+(a+b)y
=(a+b)(x+y) [Taking (a+b) common]
(ii) ax2+by2+bx2+ay2=ax2+bx2+ay2+by2 [Re-arranging the terms]
=(a+b)x2+(a+b)y2=(a+b)(x2+y2) [Takin (a+b) common]
(iii) a2+bc+ab+ac=(a2+ab)+(ac+bc) [Re-grouping the terms]
=a(a+b)+(a+b)c=(a+b)(a+c) [Taking (a+b) common]
(iv) ax−ay+by−by=a(x−y)+b(x−y)
=(a+b)(x−y) [Taking (x-y) common]