  The factorizations of the polynomial $X^n-1$ and the cyclotomic polynomial
$\Phi_n$ over a finite field $\mathbb F_q$ have been studied for a very long
time. Explicit factorizations have been given for the case that
$\mathrm{rad}(n)\mid q^w-1$ where $w=1$, $w$ is prime or $w$ is the product of
two primes. For arbitrary $a\in \mathbb F_q^\ast$ the factorization of the
polynomial $X^n-a$ is needed for the construction of constacyclic codes. Its
factorization has been determined for the case $\mathrm{rad}(n)\mid q-1$ and
for the case that there exist at most three distinct prime factors of $n$ and
$\mathrm{rad}(n)\mid q^w-1$ for a prime $w$. Both polynomials $X^n-1$ and
$X^n-a$ are compositions of the form $f(X^n)$ for a monic irreducible
polynomial $f\in \mathbb F_q[X]$. The factorization of the composition $f(X^n)$
is known for the case $\gcd(n, \mathrm{ord}(f)\cdot \mathrm{deg}(f))=1$ and
$\mathrm{rad}(n)\mid q^w-1$ for $w=1$ or $w$ prime.
  However, there does not exist a closed formula for the explicit factorization
of either $X^n-1$, the cyclotomic polynomial $\Phi_n$, the binomial $X^n-a$ or
the composition $f(X^n)$. Without loss of generality we can assume that
$\gcd(n,q)=1$. Our main theorem, Theorem 18, is a closed formula for the
factorization of $X^n-a$ over $\mathbb F_q$ for any $a\in \mathbb F_q^\ast$ and
any positive integer $n$ such that $\gcd(n,q)=1$. From our main theorem we
derive one closed formula each for the factorization of $X^n-1$ and of the
$n$-th cyclotomic polynomial $\Phi_n$ for any positive integer $n$ such that
$\gcd(n,q)=1$ (Theorem 2.5 and Theorem 2.6). Furthermore, our main theorem
yields a closed formula for the factorization of the composition $f(X^n)$ for
any irreducible polynomial $f\in \mathbb F_q[X]$, $f\neq X$, and any positive
integer $n$ such that $\gcd(n,q)=1$ (Theorem 27).
