To find the greatest common factor (it should be divisor) of an expression, you have to take the smallest power of each letter and the smallest power of each prime number that the two expressions have in common. Here you have

and

You have 2, a and b in common. Then for each one, you take the smallest power. It gives
