# You can't use \eqno' in math mode. and Missing } inserted.

i'm trying to write this equation but LateX give me these errors. I already find similar question but any of them can solve the problem. Any suggestions?

$$\rho(X,Y) = {{{E(XY) - E(X)-E(Y)}\over{\sqrt{var(X)var(Y)}}}$$


There is a missing } at the end of the equation. Or rather, a couple of extra {. You could simplify the input to:

$$\rho(X,Y) = {E(XY) - E(X)-E(Y) \over \sqrt{var(X)var(Y)}}$$


because the syntax for \over is {<subformula> \over <subformula>}, without the need of extra braces around the <subformula>s.

With proper LaTeX syntax and dedicated operators for E and var:

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\E}{E}
\DeclareMathOperator{\var}{var}
\begin{document}
$$\rho(X,Y) = \frac{\E(XY)-\E(X)-\E(Y)}{\sqrt{\var(X)\var(Y)}}$$
\end{document}
`

• thank you very much @Phelype! really clear explanation!! – Elisa m May 8 '19 at 14:19
• @Elisam You're welcome. Glad it helped :-) – Phelype Oleinik May 8 '19 at 14:25