  We give an analytical derivation of the confinement/deconfinement phase
transition at finite temperature in the $SU(N)$ Yang-Mills theory in the
$D$-dimensional space time for $D>2$. We elucidate what is the mechanism for
quark confinement and deconfinement at finite temperature and why the phase
transition occurs at a certain temperature. For this purpose, we use a novel
reformulation of the Yang-Mills theory which allows the gauge-invariant gluonic
mass term and calculate analytically the effective potential of the Polyakov
loop average concretely for the $SU(2)$ and $SU(3)$ Yang-Mills theories by
including the gauge-invariant dynamical gluonic mass. For $D=4$, we give an
estimate on the transition temperature $T_d$ as the ratio to the
gauge-invariant gluonic mass $M$ which has been measured on the lattice at zero
temperature and is calculable also at finite temperature. We show that the
order of the phase transition at $T_d$ is the second order for $SU(2)$ and
weakly first order for $SU(3)$ Yang-Mills theory. These initial results are
obtained easily based on the analytical calculations of the "one-loop type" in
the first approximation. Then these results are identified with the initial
condition in solving the flow equation of the Wetterich type to improve the
initial results in a systematic way in the framework of the functional
renormalization group. But the improvements do not change the initial results
in an essential way except for some thermodynamic observables. We argue how the
artifacts in the first approximation are eliminated to obtain the correct
behaviors for such thermodynamic observables.
