# how to fix an equation's error

I would like to write this equation: \begin{equation*}
\hat{V}(\hat{\beta}_1)= \frac{\displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2 \hat{u}_i^2}}{\left( \displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2\right)^2 }} \xrightarrow[P]{\text{\textlatin{White se}}} V(\hat{\beta}_1)= \frac{\displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2 \sigma_i^2}}{\left( \displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2\right)^2 }}
\end{equation*}


It shows me

! Missing } inserted. }

but I can't find where } is missing.

\displaystyle is a declaration and not a command with argument. Your \displaystyle{...} opens a group and so \left( and \right) end up at different grouping levels, which is not allowed.

It should be {\displaystyle ...} to limit the scope. However, the numerator and denominator of a fraction act as scope delimiters, so there's no need of additional braces in this case.

I'd not use \left and \right, however.

\documentclass{article}
\usepackage[greek]{babel} % for \textlatin
\usepackage{amsmath}

\begin{document}
\begin{equation*}
\hat{V}(\hat{\beta}_1)=
\frac
{\displaystyle\sum_{i=1}^{n} (x_i-\bar{x})^2 \hat{u}_i^2}
{\displaystyle\biggl(\,\sum_{i=1}^{n} (x_i-\bar{x})^2\biggr)^2}
\xrightarrow[P]{\text{\textlatin{White se}}}
V(\hat{\beta}_1)=
\frac
{\displaystyle\sum_{i=1}^{n} (x_i-\bar{x})^2 \sigma_i^2}
{\displaystyle\biggl(\,\sum_{i=1}^{n} (x_i-\bar{x})^2\biggr)^2}
\end{equation*}
\textlatin{Alternative}
\begin{equation*}
\hat{V}(\hat{\beta}_1)=
\frac
{\sum\limits_{i=1}^{n} (x_i-\bar{x})^2 \hat{u}_i^2}
{\Bigl(\,\sum\limits_{i=1}^{n} (x_i-\bar{x})^2\Bigr)^2}
\xrightarrow[P]{\text{\textlatin{White se}}}
V(\hat{\beta}_1)=
\frac
{\sum\limits_{i=1}^{n} (x_i-\bar{x})^2 \sigma_i^2}
{\Bigl(\,\sum\limits_{i=1}^{n} (x_i-\bar{x})^2\Bigr)^2}
\end{equation*}
\end{document}


Notice the usage of \bigl( and \bigr) that are slightly less tall than the parentheses provided by \left and \right, which in case of summations is appropriate. The \, is a refinement in order that the open parenthesis doesn't bump into the subscript.

I added also an alternative version with not so dramatically big summation signs. Your \displaystyle groups include the \right) but not the \left(

\begin{equation*}
\hat{V}(\hat{\beta}_1)= \frac{\displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2 \hat{u}_i^2}}{\left( \displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2}\right)^2 } \xrightarrow[P]{\text{\textlatin{White se}}} V(\hat{\beta}_1)= \frac{\displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2 \sigma_i^2}}{\left( \displaystyle{\sum_{i=1}^{n} (x_i-\bar{x})^2}\right)^2 }
\end{equation*}


Actually, \displaystyle doesn't take an argument so you can get rid of some of those braces:

\begin{equation*}
\hat{V}(\hat{\beta}_1)
= \frac{\displaystyle \sum_{i=1}^{n} (x_i-\bar{x})^2 \hat{u}_i^2 }
{\displaystyle \left( \sum_{i=1}^{n} (x_i-\bar{x})^2 \right)^2 }
\xrightarrow[P]{\text{\textlatin{White se}}}
V(\hat{\beta}_1)
= \frac{\displaystyle \sum_{i=1}^{n} (x_i-\bar{x})^2 \sigma_i^2 }
{ \displaystyle \left( \sum_{i=1}^{n} (x_i-\bar{x})^2 \right)^2 }
\end{equation*}

• Why \displaystyle{...}? Jul 9 '13 at 14:45
• Because without \displaystyle{...} it showed next to \sum whatever it is written above and below it.
– Y_gr
Jul 9 '13 at 14:49
• @giannis yes, I now the effect of \displaystyle; that's not what I am asking. I am talking about why not {\displaystyle...} if grouping is required. \displaystyle doesn't take arguments. Jul 9 '13 at 14:50
• @GonzaloMedina Because I was copying what giannis put and fixing the immediate error. Then I thought about how to make it a bit clearer. Jul 9 '13 at 14:53