Start by factoring the numerator. We know that \((k-5)\) is a factor. So, your answer becomes:
\((k -5)(k^2-3k+1) / (k-5)\)
Now we have two of the same terms \((k-5)\) in the numerator and the denominator, we cancel them out and are left with:
\(k^2-3k+1\)