Answer
$ x^{2n} +x^n +3+\frac{3}{x^n-5}$.
Work Step by Step
The given expression is
$\Rightarrow (x^{3n}-4x^{2n}-2x^n-12)\div (x^n-5)$
$\begin{matrix}
& x^{2n} & +x^n &+3 & & \leftarrow &Quotient\\
&-- &-- &--&--& \\
x^n-5) &x^{3n}&-4x^{2n}&-2x^n&-12 & \\
& x^{3n} & -5x^{2n} & & & \leftarrow &x^{2n}(x^n-5) \\
& -- & -- & & & \leftarrow &subtract \\
& 0 & x^{2n} & -2x^n & & \\
& & x^{2n} & -5x ^n & & \leftarrow & x^{n}(x^n-5) \\
& & -- & -- & & \leftarrow & subtract \\
& & 0&3x^n &-12 & \\
& & & 3x^n&-15 & \leftarrow & 3(x^n-5)) \\
& & & -- & -- & \leftarrow & subtract \\
& & & 0 & 3 & \leftarrow & Remainder
\end{matrix}$
The solution is
$\Rightarrow Quotient +\frac{Remainder}{Divisor}$.
Substitute all values.
$\Rightarrow x^{2n} +x^n +3+\frac{3}{x^n-5}$.