If we compare the given expression with x2+(a+b)x+ab, then;
a+b=5⋯(i) & ab=6⋯(ii)
Now, we will try putting the values for a & b for which they satisfy the above two equations.
After checking for a few combinations, we can tell a=2,b=3 is one of the possible desired combinations as it satisfies both the equations simultaneously.