Expectation (E) in LaTeX (E[X])

E[X]E[X]
LaTeX command
E[X]
Package
No package needed: built into LaTeX
Mode
Text and math mode

Where it is used

Expectation of X in plain italic E, the mean of its distribution.

Many statistics textbooks write E[X] or E(X) for the expected value, with the variance identity \operatorname{Var}(X) = E[X^2] - (E[X])^2 as a standard example. An italic E can collide with other meanings such as energy or an event called E, which is why \mathbb{E} or an upright \mathrm{E} are common in research papers. If you settle on upright, define \DeclareMathOperator{\E}{E} so spacing and font stay uniform everywhere. Conditional expectation follows the same style, E[X \mid Y]. Whichever form you choose, use it consistently from start to finish.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

E[X2]−(E[X])2≥0E[X^2] - (E[X])^2 \geq 0
\documentclass{article}
\begin{document}
Expectation (E): $E[X]$

\[ E[X^2] - (E[X])^2 \geq 0 \]
\end{document}

Related symbols

All Probability at Statistics →

Frequently asked questions

How do I write Expectation (E) in LaTeX?
Type E[X] in math mode, for example $E[X^2] - (E[X])^2 \geq 0$. It works in plain LaTeX without loading any package.
Which package do I need for E[X]?
None. E[X] is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use E[X] in text mode, or only in math mode?
Both. E[X] compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers