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 確率・統計 →

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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得