So we need to find what multiplies to 10 and adds to 7. The most immediate answer is 5 and 2. Though we have two variables, the factored portion is mostly the same. Your answer should come out as:
(a+5b)(a+2b)
You may distribute to check the answer:
Once distributed, they multiply to: a^2+7ab+b^2 Which is the original question, so it checks out.