4. Simplify the fraction $\frac{a^{2 x+2}+a^{2 x+1}-16 a^{2 x}-16 a^{2 x-1}}{a^{2 x+1}+5 a^{2 x}+4 a^{2 x-1}}$.
4. We factor out the common factor in the numerator $a^{2 x-1}\left(a^{3}+a^{2}-16 a-16\right)$ and in the denominator $a^{2 x-1}\left(a^{2}+5 a+4\right)$. The common factor $a^{2 x-1}$ can be canceled out. We factor the numerator by factoring out the common factor $a^{2}(a+1)-16(a+1)=(a+1)\left(a^{2}-16\right)=(a+1)(a+4)(a-4)$. We factor the denominator using Vieta's formulas $(a+1)(a+4)$. We simplify the fraction and get $a-4$.

Factoring out the common factor in the numerator $a^{2 x-1}\left(a^{3}+a^{2}-16 a-16\right)$ ..... 1 point
Factoring out the common factor in the denominator $a^{2 x-1}\left(a^{2}+5 a+4\right)$ ..... 1 point
Factoring in the numerator $a^{2}(a+1)-16(a+1)$ ..... 1 point
Factoring the numerator $(a+1)(a+4)(a-4)$ ..... 1 point
Simplifying ..... 1 point
Factoring the denominator $(a+1)(a+4)$ ..... 1 point
Result $a-4$ ..... 1 point