[tex]\begin{array}{c|c}_{-}\ x^4+2x^2-24 &\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \underline{ x+2 } \\ \!\!\!\!\!\!\!\!\!\!\! \underline{x^4+2x^3}& x^3-2x^2+4x-8 \\{ \big{_{-}}}-2x^3-24& \\\underline{-2x^3-4x^2}& \\ _{-} \ 4x^2-24 & \\ \underline{4x^2+8x}& \\ _{-}-8x-24& \\ \underline{-8x-16} & \\ -8 &\end {array }[/tex]
[tex]\displaystyle \frac{x^4+2x^2-24}{x+2} =x^3-2x^2+4x-8 -\frac{8}{x+2}[/tex]