% All possible sizes of the various mathdots tested
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathdots}

\newcommand\testdots{%
$\ddots^{\ddots^{\ddots}}$ $\iddots^{\iddots^{\iddots}}$
$\vdots^{\vdots^{\vdots}}$
\par
$\dot{X}
\ddot{X}
\dddot{X}
\ddddot{X}
X^{\dot{X}}
X^{\ddot{X}}
X^{\dddot{X}}
X^{\ddddot{X}}
X^{X^{\dot{X}}}
X^{X^{\ddot{X}}}
X^{X^{\dddot{X}}}
X^{X^{\ddddot{X}}}$
\par\smallskip\hrule\smallskip}

\setlength\textwidth{6.664in}
\setlength\oddsidemargin{-.082in}
\setlength\parindent{0pt}

\setlength{\textheight}{8.9in}
\setlength{\topmargin}{0pt}
\addtolength\headheight{3.06pt}
\addtolength\topmargin{-\headheight}
\addtolength\topmargin{-\headsep}

\begin{document}
\pagestyle{headings}
\tableofcontents
\clearpage

\section{Testing in headers and TOC:
    $\ddots$, $\vdots$, $\iddots$, $\dddot{X}$ and $\ddddot{X}$}

\tiny tiny \testdots
\scriptsize scriptsize \testdots
\footnotesize footnotesize \testdots
\small small \testdots
\normalsize normalsize \testdots
\large large \testdots
\Large Large \testdots
\huge huge \testdots
\Huge Huge \testdots

\end{document}
