Using long division, we have
[tex]a^{2}-1
____________________
a^{n}+8 | a^{2n} -a^{n}-6
-(a^{2n}+8a^{2})
-a^{n}-8a^{2}-6
-(-a^{n}+8)
-8a^{2}-14[/tex]
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