[Tex/LaTex] How to denote the fifth derivative in Newton’s notation

accentsmath-mode

I am trying to set five dots on the top of a letter in order to denote the fifth derivative in Newton’s notation. If I do
one dot \dot{X},
two dots \ddot{X},
three dots \dddot{X},
four dots \dddot{X}
it's fine. But when you are going to five dots this command is not working. like:
five dots \dddddot{X}.

Do you have any idea how to set five dots?

Best Answer

The problem is that each macro has to be defined, and there is only up to \ddddot.

So I made two macros: \dddddot, and \multidots. For both of them I copied the definition of \ddddot and added dots.

\dddddot will put five dots on top of its argument. \multidots{n}{arg} will put n dots on top of arg.

enter image description here

\documentclass{article}

\usepackage{amsmath}

\makeatletter
\long\def\dddddot#1{%
  {\mathop {#1}\limits ^{\vbox to-1.4\ex@ {\kern -\tw@ \ex@ \hbox {\normalfont .....}\vss }}}%
}
\long\def\multidots#1#2{%
  \count@=0
  {{\mathop {#2}\limits ^{\vbox to-1.4\ex@ {\kern -\tw@ \ex@ \hbox {\normalfont %
  \loop%
  \ifnum#1>\count@%
  .%
  \advance\count@ by1%
  \repeat%
  }\vss }}}}%
}
\makeatother

\begin{document}

$\dot{X}$ two dots $\ddot{X}$ three dots $\dddot{X}$ four dots $\ddddot{X}$ five dots $\dddddot{X}$

$\multidots{1}{X}$ two dots $\multidots{2}{X}$ three dots $\multidots{3}{X}$ four dots $\multidots{4}{X}$ five dots $\multidots{5}{X}$ lots of dots $\multidots{15}{X}$
\end{document}

We can add an \hbox to 0pt to hide the width of the dots and make the spacing right on the sides of the X. Although the dots will go over the rest of the text... It's a matter of choice:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\makeatletter
\long\def\dddddot#1{%
  {\mathop {#1}\limits ^{\vbox to-1.4\ex@ {\kern -\tw@ \ex@ \hbox {\normalfont .....}\vss }}}%
}
\long\def\multidots#1#2{%
  \count@=0
  {{\mathop {#2}\limits ^{\hbox to 0pt{\vbox to-1.4\ex@ {\kern -\tw@ \ex@ \hbox {\normalfont %
  \loop%
  \ifnum#1>\count@%
  .%
  \advance\count@ by1%
  \repeat%
  }\vss }}}}}%
}
\makeatother

\begin{document}

$\dot{X}$ two dots $\ddot{X}$ three dots $\dddot{X}$ four dots $\ddddot{X}$ five dots $\dddddot{X}$

$\multidots{1}{X}$ two dots $\multidots{2}{X}$ three dots $\multidots{3}{X}$ four dots $\multidots{4}{X}$ five dots $\multidots{5}{X}$ lots of dots $\multidots{15}{X}$
\end{document}
Related Question