Why do \sqrt{1} and \sqrt{-1} have different heights?

I noticed that the heights of \sqrt{1} and \sqrt{-1} are different. For instance, when they are in between \left( and \right) parentheses, I must write a character of zero-width (e.g. \sqrt{-1\mathstrut}).

Why do \sqrt{1} and \sqrt{-1} behave so different?

This is an example with a slightly more complicated expression:

\documentclass[]{article}

\begin{document}
$$\left( 10 + \sqrt{7}\, \right)^{1/3}$$
$$\left( 10 + \sqrt{-7}\, \right)^{1/3}$$
$$\left( 10 + \sqrt{+7}\, \right)^{1/3}$$
\end{document}


The following image shows the output of latex. I obtain similar results with pdflatex, xelatex and lualatex. Notice that \sqrt{+7} behaves as \sqrt{-7}, but different from \sqrt{7}.

• Please, could you compose a minimal example so that we see what exact font setup you have? And which compiler do you use -- latex, pdflatex, xelatex or lualatex? – yo' Nov 20 '16 at 21:42
• @yo' done. Also added an expression with more terms showing the same behavior. – vagoberto Nov 20 '16 at 23:26

You can see that in the case of \sqrt{-1} the radical sign is a bit lower; if you do \sqrt{\smash{-}1}, the result will be the same.

This happens because the - character has a depth (equal to that of +).

On the other hand, you shouldn't use \left and \right in those cases. Note \, to space a bit the closing parenthesis.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{2}
\\
\end{alignat*}

\end{document}


More details. The character + extends below the baseline, so Knuth decided that - (in math mode, the minus sign) should share the same dimensions as +. This is true for the Computer Modern fonts, and may not be the case with other fonts.

This way, the two formulas $a+b$ and $a-b$ have the same height and depth, but 1 and -1 don't: the latter has nonzero depth.

The radical sign is placed so it is vertically balanced with respect to the subformula it has to cover and, indeed, it is higher in \sqrt{1} than in \sqrt{-1}. This difference is sufficient for triggering a bigger size of the parentheses in the former case.

• And \sqrt{\vphantom{-}1 should then give the smaller parentheses, right? – yo' Nov 20 '16 at 21:46
• So I guess the \sqrt{-1} is complex. :) – Alan Munn Nov 20 '16 at 21:49
• I do not know what "depth" is, but this looks like a bug. – Alexey Nov 20 '16 at 22:23
• @egreg I know a \left and \right are useless in such basic expression, but it serves to show what I meant. I edited my question to show another example. But I expect that \sqrt{} will consider the total height of its argument to draw the sqrt symbol. Then, does the number -1 have a smaller \depth or \totalheight than 1? – vagoberto Nov 20 '16 at 23:39
• @Alexey See here to see what depth is. – vagoberto Nov 20 '16 at 23:43