2 answers
(click or scroll down)
check by expanding your answer, you will see that the first one is wrong
you probably meant
a^3 - 5a^2 + 2a -10 , says by grouping, so do that ...
= a^2(a-5) + 2(a-5)
= (a-5)(a^2 + 2)