Using long division, we have

The parenthesis are the result of what we multiply (a^n+8) by (we multiply it by the top expression - we start with a^2 then -1), and what's not is the result of adding the parenthesis to the expression about that.
Our final result is (a^n+8)*(a^2-1)-8a^2-14