21) \(=ab\left(x-5\right)+a^2\left(x-5\right)=a\left(x-5\right)\left(a+b\right)\)
22) \(=2a^2\left(x-y\right)+4a\left(x-y\right)=2a\left(x-y\right)\left(a+2\right)\)
23) \(a\left(x-3\right)+a^2\left(x-3\right)=a\left(x-3\right)\left(a+1\right)\)
24) \(=5x^2y\left(x-7\right)+5xy\left(x-7\right)=5xy\left(x-y\right)\left(x+1\right)\)
25) \(=2xy\left(a-1\right)+4x^2y\left(a-1\right)=2xy\left(a-1\right)\left(2x+1\right)\)
26) \(=4a\left(x-3\right)+2\left(x-3\right)=2\left(x-3\right)\left(2a+1\right)\)
27) \(=x^m\left(x-1\right)\)
28) \(=x^m\left(x+1\right)\)
29) \(=x^m\left(x^2-1\right)\)
30) \(=x^{m+1}\left(x-1\right)\)